Add new internal upload target for Google Cloud Platform and osbuild-upload-gcp CLI tool which uses the API. Supported features are: - Authenticate with GCP using explicitly provided JSON credentials file or let the authentication be handled automatically by the Google cloud client library. The later is useful e.g. when the worker is running in GCP VM instance, which has associated permissions with it. - Upload an existing image file into existing Storage bucket. - Verify MD5 checksum of the uploaded image file against the local file's checksum. - Import the uploaded image file into Compute Node as an Image. - Delete the uploaded image file after a successful image import. - Delete all cache files from storage created as part of the image import build job. - Share the imported image with a list of specified accounts. GCP-specific image type is not yet added, since GCP supports importing VMDK and VHD images, which the osbuild-composer already supports. Update go.mod, vendor/ content and SPEC file with new dependencies. Signed-off-by: Tomas Hozza <thozza@redhat.com>
45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/jstemmer/go-junit-report/formatter"
|
|
"github.com/jstemmer/go-junit-report/parser"
|
|
)
|
|
|
|
var (
|
|
noXMLHeader = flag.Bool("no-xml-header", false, "do not print xml header")
|
|
packageName = flag.String("package-name", "", "specify a package name (compiled test have no package name in output)")
|
|
goVersionFlag = flag.String("go-version", "", "specify the value to use for the go.version property in the generated XML")
|
|
setExitCode = flag.Bool("set-exit-code", false, "set exit code to 1 if tests failed")
|
|
)
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
if flag.NArg() != 0 {
|
|
fmt.Fprintf(os.Stderr, "%s does not accept positional arguments\n", os.Args[0])
|
|
flag.Usage()
|
|
os.Exit(1)
|
|
}
|
|
|
|
// Read input
|
|
report, err := parser.Parse(os.Stdin, *packageName)
|
|
if err != nil {
|
|
fmt.Printf("Error reading input: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
// Write xml
|
|
err = formatter.JUnitReportXML(report, *noXMLHeader, *goVersionFlag, os.Stdout)
|
|
if err != nil {
|
|
fmt.Printf("Error writing XML: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
if *setExitCode && report.Failures() > 0 {
|
|
os.Exit(1)
|
|
}
|
|
}
|