worker: pass build environment to osbuild

Detect it from the host using the distro package.
This commit is contained in:
Lars Karlitski 2019-11-28 21:05:31 +01:00
parent 85e6182bdc
commit 5dad3bfc8e
6 changed files with 48 additions and 6 deletions

View file

@ -31,6 +31,9 @@ type Distro interface {
// output format with all packages and customizations specified in the
// given blueprint.
Pipeline(b *blueprint.Blueprint, outputFormat string) (*pipeline.Pipeline, error)
// Returns a osbuild runner that can be used on this distro.
Runner() string
}
var registered map[string]Distro

View file

@ -343,6 +343,10 @@ func (r *Fedora30) Pipeline(b *blueprint.Blueprint, outputFormat string) (*pipel
return p, nil
}
func (r *Fedora30) Runner() string {
return "org.osbuild.fedora30"
}
func (r *Fedora30) buildPipeline() *pipeline.Pipeline {
packages := []string{
"dnf",

View file

@ -373,6 +373,10 @@ func (r *RHEL82) Pipeline(b *blueprint.Blueprint, outputFormat string) (*pipelin
return p, nil
}
func (r *RHEL82) Runner() string {
return "org.osbuild.rhel82"
}
func (r *RHEL82) buildPipeline() *pipeline.Pipeline {
packages := []string{
"dnf",

View file

@ -36,3 +36,7 @@ func (d *TestDistro) FilenameFromType(outputFormat string) (string, string, erro
func (d *TestDistro) Pipeline(b *blueprint.Blueprint, outputFormat string) (*pipeline.Pipeline, error) {
return nil, errors.New("invalid output format: " + outputFormat)
}
func (d *TestDistro) Runner() string {
return "org.osbuild.test"
}