-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from adfinis/jlf/feat-update-logging-and-outpu…
…t-functionality feat: update logging and output functionality
- Loading branch information
Showing
24 changed files
with
347 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Logging and output | ||
|
||
We use the logging facility for both debugging and output to the user. If you | ||
want to output a normal message (replacement of `print()`) use `lg.warn()`. The | ||
name might feel counter-intuitive, but I don't want to hack the logging-system | ||
and add new levels. `INFO` is basically reseved for successful commands. | ||
Unsuccessful commands are logged on `ERROR`. You can also hide unsuccessful command | ||
using `hide_error=True` in `run_command`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,75 @@ | ||
# Pyaptly | ||
|
||
Automates the creation and managment of aptly mirrors and snapshots based on yml | ||
Automates the creation and managment of aptly mirrors and snapshots based on toml | ||
input files. | ||
|
||
**Important**: Corrently under heavy development: | ||
|
||
- For for the old version [switch to the master branch](https://github.com/adfinis/pyaptly/tree/master) | ||
- Main branch builds contain [alpha packages](https://github.com/adfinis/pyaptly/actions/runs/8147002919), see Artifacts | ||
|
||
## Example commands | ||
|
||
Initialize a new aptly server. | ||
|
||
```shell | ||
pyaptly -c mirrors.toml mirror create | ||
pyaptly -c mirrors.toml mirror update | ||
pyaptly -c mirrors.toml snapshot create | ||
pyaptly -c mirrors.toml publish create | ||
``` | ||
|
||
Update mirrors and snapshots and switch publish endpoints with | ||
```automatic-update: true``` to the new snapshots. | ||
|
||
```shell | ||
pyaptly -c mirrors.toml mirror update | ||
pyaptly -c mirrors.toml snapshot create | ||
pyaptly -c mirrors.toml publish create | ||
pyaptly -c mirrors.toml publish update | ||
``` | ||
|
||
Manually trigger a switch to the new snapshots for the publish endpoint | ||
ubuntu/stable. | ||
|
||
```shell | ||
pyaptly -c mirrors.toml publish update ubuntu/stable | ||
``` | ||
|
||
## Debugging | ||
|
||
The most interesting mode for users is not `--debug` but `--info` which shows | ||
all commands executed. | ||
|
||
```bash | ||
> pyaptly legacy -- --info --config pyaptly/tests/repo.toml repo create | ||
Command call | ||
cmd: gpg --no-default-keyring --keyring trustedkeys.gpg --list-keys --with-colons -> 0 | ||
stdout: 'tru::1:1709575833:0:3:1:5 | ||
pub:-:255:22:2841988729C7F3FF:1701882080:::-:::scESC:::::ed25519:::0: | ||
fpr:::::::::6380C07FF6496016E01CF4522841988729C7F3FF: | ||
uid:-::::1701882080::5BBE9C7E7AA5EEE3538F66274125D69FA727FD1E::Pyaptly Test 01 <[email protected]>::::::::::0: | ||
sub:-:255:18:0A1CBEF26FE4F36E:1701882080::::::e:::::cv25519:: | ||
fpr:::::::::9EE64E40A5E3530D3E18A97C0A1CBEF26FE4F36E: | ||
pub:-:255:22:EC54D33E5B5EBE98:1701882297:::-:::scESC:::::ed25519:::0: | ||
fpr:::::::::660D45228AB6B59CCE48AFB3EC54D33E5B5EBE98: | ||
uid:-::::1701882297::F3EF71B78669C0FC259A4078151BDC5815A6015D::Pyaptly Test 02 <[email protected]>::::::::::0: | ||
sub:-:255:18:042FE0F5BB743B60:1701882297::::::e:::::cv25519:: | ||
fpr:::::::::AE58B62134E02AF8E5D55FF4042FE0F5BB743B60:' | ||
Command call | ||
cmd: aptly repo list -raw -> 0 | ||
stderr: 'Config file not found, creating default config at /root/.aptly.conf' | ||
Command call | ||
cmd: aptly mirror list -raw -> 0 | ||
Command call | ||
cmd: aptly snapshot list -raw -> 0 | ||
Command call | ||
cmd: aptly publish list -raw -> 0 | ||
Command call | ||
cmd: aptly repo -architectures=amd64,i386 -distribution=stable -component=main create centrify -> 0 | ||
stdout: 'Local repo [centrify] successfully added. | ||
You can run 'aptly repo add centrify ...' to add packages to repository.' | ||
``` | ||
|
||
Commands that fail are always displayed in red on a tty, but that actually only | ||
happens if something is broken. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.