Skip to content

Commit

Permalink
fix(pipeline): clone image flag for compiler (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper authored May 17, 2024
1 parent b1e221d commit 88582e2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion command/pipeline/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ var CommandExec = &cli.Command{
Usage: "set the starlark execution step limit for compiling starlark pipelines",
Value: 7500,
},
&cli.StringFlag{
EnvVars: []string{"VELA_CLONE_IMAGE", "COMPILER_CLONE_IMAGE"},
Name: "clone-image",
Usage: "the clone image to use for the injected clone step",
// renovate: image=target/vela-git
Value: "target/vela-git:v0.8.0@sha256:02de004ae9dbf184c70039cb9ce431c31d6e7580eb9e6ec64a97ebf108aa65cb",
},

// Environment Flags
&cli.BoolFlag{
Expand Down Expand Up @@ -326,7 +333,7 @@ func exec(c *cli.Context) error {
// set max template depth to minimum of 5 and provided value if local templates are not provided.
// This prevents users from spamming SCM
client.SetTemplateDepth(util.MinInt(c.Int("max-template-depth"), 5))
logrus.Debugf("no local template files provided, setting max template depth to %d", client.TemplateDepth)
logrus.Debugf("no local template files provided, setting max template depth to %d", client.GetTemplateDepth())
}

// execute the exec call for the pipeline configuration
Expand Down
9 changes: 8 additions & 1 deletion command/pipeline/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ var CommandValidate = &cli.Command{
Aliases: []string{"cgu"},
Usage: "github url, used by compiler, for pulling registry templates",
},
&cli.StringFlag{
EnvVars: []string{"VELA_CLONE_IMAGE", "COMPILER_CLONE_IMAGE"},
Name: "clone-image",
Usage: "the clone image to use for the injected clone step",
// renovate: image=target/vela-git
Value: "target/vela-git:v0.8.0@sha256:02de004ae9dbf184c70039cb9ce431c31d6e7580eb9e6ec64a97ebf108aa65cb",
},
},
CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
Expand Down Expand Up @@ -257,7 +264,7 @@ func validate(c *cli.Context) error {
// set max template depth to minimum of 5 and provided value if local templates are not provided.
// This prevents users from spamming SCM
client.SetTemplateDepth(util.MinInt(c.Int("max-template-depth"), 5))
logrus.Debugf("no local template files provided, setting max template depth to %d", client.TemplateDepth)
logrus.Debugf("no local template files provided, setting max template depth to %d", client.GetTemplateDepth())
}

// execute the validate local call for the pipeline configuration
Expand Down

0 comments on commit 88582e2

Please sign in to comment.