mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-06 05:30:57 +00:00
f61514edaf
Using bzip2 generates smaller index files (roughly 20% smaller Packages
files) but it comes with a big performance penalty. When publishing a
debian mirror snapshot (amd64, arm64, armhf, source) without contents
skipping bzip speeds things up around 1.8 times.
```
$ hyperfine -w 1 -L skip-bz2 true,false -m 3 -p "aptly -config aptly.conf publish drop bullseye || true" "aptly -config aptly.conf publish snapshot --skip-bz2={skip-bz2} --skip-contents --skip-signing bullseye"
Benchmark 1: aptly -config aptly.conf publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye
Time (mean ± σ): 35.567 s ± 0.307 s [User: 39.366 s, System: 10.075 s]
Range (min … max): 35.311 s … 35.907 s 3 runs
Benchmark 2: aptly -config aptly.conf publish snapshot --skip-bz2=false --skip-contents --skip-signing bullseye
Time (mean ± σ): 64.740 s ± 0.135 s [User: 68.565 s, System: 10.129 s]
Range (min … max): 64.596 s … 64.862 s 3 runs
Summary
'aptly -config aptly.conf publish snapshot --skip-bz2=true --skip-contents --skip-signing bullseye' ran
1.82 ± 0.02 times faster than 'aptly -config aptly.conf publish snapshot --skip-bz2=false --skip-contents --skip-signing bullseye'
```
Allow skipping bz2 creation for setups where faster publishing is more
important then Package file size.
Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
56 lines
2.5 KiB
Go
56 lines
2.5 KiB
Go
package cmd
|
|
|
|
import (
|
|
"github.com/smira/commander"
|
|
"github.com/smira/flag"
|
|
)
|
|
|
|
func makeCmdPublishRepo() *commander.Command {
|
|
cmd := &commander.Command{
|
|
Run: aptlyPublishSnapshotOrRepo,
|
|
UsageLine: "repo <name> [[<endpoint>:]<prefix>]",
|
|
Short: "publish local repository",
|
|
Long: `
|
|
Command publishes current state of local repository ready to be consumed
|
|
by apt tools. Published repostiories appear under rootDir/public directory.
|
|
Valid GPG key is required for publishing.
|
|
|
|
Multiple component repository could be published by specifying several
|
|
components split by commas via -component flag and multiple local
|
|
repositories as the arguments:
|
|
|
|
aptly publish repo -component=main,contrib repo-main repo-contrib
|
|
|
|
It is not recommended to publish local repositories directly unless the
|
|
repository is for testing purposes and changes happen frequently. For
|
|
production usage please take snapshot of repository and publish it
|
|
using publish snapshot command.
|
|
|
|
Example:
|
|
|
|
$ aptly publish repo testing
|
|
`,
|
|
Flag: *flag.NewFlagSet("aptly-publish-repo", flag.ExitOnError),
|
|
}
|
|
cmd.Flag.String("distribution", "", "distribution name to publish")
|
|
cmd.Flag.String("component", "", "component name to publish (for multi-component publishing, separate components with commas)")
|
|
cmd.Flag.String("gpg-key", "", "GPG key ID to use when signing the release")
|
|
cmd.Flag.Var(&keyRingsFlag{}, "keyring", "GPG keyring to use (instead of default)")
|
|
cmd.Flag.String("secret-keyring", "", "GPG secret keyring to use (instead of default)")
|
|
cmd.Flag.String("passphrase", "", "GPG passphrase for the key (warning: could be insecure)")
|
|
cmd.Flag.String("passphrase-file", "", "GPG passphrase-file for the key (warning: could be insecure)")
|
|
cmd.Flag.Bool("batch", false, "run GPG with detached tty")
|
|
cmd.Flag.Bool("skip-signing", false, "don't sign Release files with GPG")
|
|
cmd.Flag.Bool("skip-contents", false, "don't generate Contents indexes")
|
|
cmd.Flag.Bool("skip-bz2", false, "don't generate bzipped indexes")
|
|
cmd.Flag.String("origin", "", "origin name to publish")
|
|
cmd.Flag.String("notautomatic", "", "set value for NotAutomatic field")
|
|
cmd.Flag.String("butautomaticupgrades", "", "set value for ButAutomaticUpgrades field")
|
|
cmd.Flag.String("label", "", "label to publish")
|
|
cmd.Flag.String("suite", "", "suite to publish (defaults to distribution)")
|
|
cmd.Flag.Bool("force-overwrite", false, "overwrite files in package pool in case of mismatch")
|
|
cmd.Flag.Bool("acquire-by-hash", false, "provide index files by hash")
|
|
|
|
return cmd
|
|
}
|