debian-forge-composer/internal/distro/test/distro.go
Tom Gundersen d33fc5f010 composer: add provisional multi-arch support
The pipeline generation now takes the architecture as an argument.
Currently only x86_64 is supported. The architecture is detected
at start-up, and passed down to each pipeline translation.

For osbuild-pipeline we now requrie the architecture to be passed
in.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-12-11 15:23:24 +01:00

42 lines
1 KiB
Go

package test
import (
"errors"
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/pipeline"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
)
type TestDistro struct{}
func init() {
distro.Register("test", &TestDistro{})
}
func (d *TestDistro) Repositories() []rpmmd.RepoConfig {
return []rpmmd.RepoConfig{
{
Id: "test",
Name: "Test",
BaseURL: "http://example.com/test/os",
},
}
}
func (d *TestDistro) ListOutputFormats() []string {
return []string{}
}
func (d *TestDistro) FilenameFromType(outputFormat string) (string, string, error) {
return "", "", errors.New("invalid output format: " + outputFormat)
}
func (d *TestDistro) Pipeline(b *blueprint.Blueprint, checksums map[string]string, outputArch, outputFormat string) (*pipeline.Pipeline, error) {
return nil, errors.New("invalid output format or arch: " + outputFormat + " @ " + outputArch)
}
func (d *TestDistro) Runner() string {
return "org.osbuild.test"
}