debian-forge-composer/internal/target/gcp_target.go
Tomáš Hozza 5b414a4516 Target: expose osbuild artifact information in target result
Add the information about osbuid artifact to the target result.
Specifically the name of the osbuild pipeline which was exported for the
specific target, and the filename of the exported file.

This will later enable embedding this information in Koji build metadata
to make it easy to reproduce the image build using the attached
manifest.
2023-09-27 12:39:28 +02:00

33 lines
1.1 KiB
Go

package target
const TargetNameGCP TargetName = "org.osbuild.gcp"
type GCPTargetOptions struct {
Region string `json:"region"`
Os string `json:"os"` // not exposed in cloudapi for now
Bucket string `json:"bucket,omitempty"`
Object string `json:"object"`
ShareWithAccounts []string `json:"shareWithAccounts,omitempty"`
// If provided, these credentials are used by the worker to import the image
// to GCP. If not provided, the worker will try to authenticate using the
// credentials from worker's configuration.
Credentials []byte `json:"credentials,omitempty"`
}
func (GCPTargetOptions) isTargetOptions() {}
func NewGCPTarget(options *GCPTargetOptions) *Target {
return newTarget(TargetNameGCP, options)
}
type GCPTargetResultOptions struct {
ImageName string `json:"image_name"`
ProjectID string `json:"project_id"`
}
func (GCPTargetResultOptions) isTargetResultOptions() {}
func NewGCPTargetResult(options *GCPTargetResultOptions, artifact *OsbuildArtifact) *TargetResult {
return newTargetResult(TargetNameGCP, options, artifact)
}