upload/koji: use CGInitBuild and clarify metadata structs

Move to requiring CGInitBuild to be called before CGImport. In the
future we could make the former optional again, but for now we want to
allow the caller to have done CGInitBuild and for composer only to do
the CGImport using the passed in build_id and token.

Also rename and document some struct fields in the metadata struct to
make them more specific to our use-case and hopefully easier to read.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-09-07 12:12:02 +01:00
parent e4b839b31f
commit f446613d4a
6 changed files with 149 additions and 65 deletions

View file

@ -3,6 +3,9 @@ package target
type KojiTargetOptions struct {
BuildID uint64 `json:"build_id"`
Token string `json:"token"`
Name string `json:"name"`
Version string `json:"version"`
Release string `json:"release"`
Filename string `json:"filename"`
UploadDirectory string `json:"upload_directory"`
Server string `json:"server"`