osbuild-pipeline: add tool to print pipelines to stdout
This tool outputs the pipeline associated with each output type. In the future this should grow to take a blueprint as an input, and also allow the arch/os/version/variant to be configured. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
22254637f8
commit
b0d9423b73
1 changed files with 27 additions and 0 deletions
27
cmd/osbuild-pipeline/main.go
Normal file
27
cmd/osbuild-pipeline/main.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"os"
|
||||
"osbuild-composer/internal/blueprint"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var format string
|
||||
flag.StringVar(&format, "output-format", "qcow2", "output format")
|
||||
flag.Parse()
|
||||
|
||||
blueprint := &blueprint.Blueprint{}
|
||||
pipeline, err := blueprint.ToPipeline(format)
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
bytes, err := json.Marshal(pipeline)
|
||||
if err != nil {
|
||||
panic("could not marshal pipeline into JSON")
|
||||
}
|
||||
|
||||
os.Stdout.Write(bytes)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue