Files
kata-containers/tools/packaging/cmd/kata-pkgsync
bin 03546f75a6 runtime: change io/ioutil to io/os packages
Change io/ioutil to io/os packages because io/ioutil package
is deprecated from 1.16:

Discard => io.Discard
NopCloser => io.NopCloser
ReadAll => io.ReadAll
ReadDir => os.ReadDir
ReadFile => os.ReadFile
TempDir => os.MkdirTemp
TempFile => os.CreateTemp
WriteFile => os.WriteFile

Details: https://go.dev/doc/go1.16#ioutil

Fixes: #3265

Signed-off-by: bin <bin@hyper.sh>
2021-12-15 07:31:48 +08:00
..
2020-06-23 22:58:18 -07:00
2021-07-30 10:58:22 +01:00
2021-03-31 23:51:20 +02:00

Kata OBS to Packagecloud sync tool

kata-pkgsync is a tool to synchronize Kata package from OBS to Packagecloud.

How it works

kata-pkgsync autonomously discovers OBS packages, repositories, and architectures in a OBS project. It can detect:

  • which of the binary files published on OBS are already stored on Packagecloud,
  • which ones still needs to be synchronized,
  • which packages on Packagecloud are orphans, i.e. do not have a corresponding file published on OBS.

Based on this information, kata-pkgsyncs can download only the necessary files from OBS, upload them on Packagecloud, and delete orphans Packagecloud packages.

Detailed behaviour

This is the sequence of tasks executed:

  1. Fetch the configuration from a YAML config file.
  2. For each OBS project specified, retrieve the available repositories, architectures, packages. For each combination of {repository,architecture,package}, retrieve the list of the build artifacts (i.e. the "rpm" / "deb" package files).
  3. Get the list of files/packages already uploaded on Packagecloud. This is to avoid re-uploading packages already sent to Packagecloud.
  4. Build a list of files that needs to be synchronized from OBS to Packagecloud, and identify which of the Packagecloud files have a corresponding file published on OBS.
  5. Download the identified files from OBS. The download phase create a local cache of packages, to avoid re-downloading files if already done.
  6. Upload the identified files to Packagecloud.
  7. Optionally, delete orphans files from Packagecloud.

Install and Usage

Install with:

$ go get github.com/kata-containers/kata-containers`

Create your configuration:

$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/cmd/kata-pkgsync
$ cp config-example.yaml config.yaml

Run in "default" mode:

$ ~/go/bin/kata-pkgsync

See the help (kata-pkgsync -h) for more details.