Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
#23 Use image helper to run with artifacts from rocker
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriy Bogdanov committed Oct 20, 2015
1 parent 5c5817d commit f1c1b7e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/cmd/rocker-compose/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func main() {
Usage: "Set variables to pass to build tasks, value is like \"key=value\"",
},
cli.StringSliceFlag{
Name: "vars-file",
Name: "vars",
Value: &cli.StringSlice{},
Usage: "Load variables form a file, either JSON or YAML. Can pass multiple of this.",
},
Expand All @@ -95,6 +95,10 @@ func main() {
Name: "print",
Usage: "just print the rendered compose config and exit",
},
cli.BoolFlag{
Name: "demand-artifacts",
Usage: "fail if artifacts not found for {{ image }} helpers",
},
}

app.Flags = append([]cli.Flag{
Expand Down Expand Up @@ -510,7 +514,7 @@ func initComposeConfig(ctx *cli.Context, dockerCli *docker.Client) *config.Confi
print = ctx.Bool("print")
)

vars, err := template.VarsFromFileMulti(ctx.StringSlice("vars-file"))
vars, err := template.VarsFromFileMulti(ctx.StringSlice("vars"))
if err != nil {
log.Fatal(err)
os.Exit(1)
Expand All @@ -524,6 +528,10 @@ func initComposeConfig(ctx *cli.Context, dockerCli *docker.Client) *config.Confi

vars = vars.Merge(cliVars)

if ctx.Bool("demand-artifacts") {
vars["DemandArtifacts"] = true
}

// TODO: find better place for providing this helper
funcs := map[string]interface{}{
// lazy get bridge ip
Expand Down

0 comments on commit f1c1b7e

Please sign in to comment.