Skip to content

Commit

Permalink
chore(playbook): allow git and env templating in params
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and moshloop committed Oct 8, 2024
1 parent c5121df commit 48b5162
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ charts/.devenv*
devenv.local.nix
ginkgo.report
mission-control.properties
test.properties
cover.out
coverprofile.out
*.test
junit-report.xml
nohup.out
.envrc
.envrc
3 changes: 3 additions & 0 deletions cmd/playbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ var Run = &cobra.Command{
run, err := playbook.Run(ctx, p, *params)
if err != nil {
logger.Errorf("%+v", err)
shutdown.ShutdownAndExit(1, err.Error())
return
}

Expand All @@ -146,11 +147,13 @@ var Run = &cobra.Command{
action, step, err = runner.GetNextActionToRun(ctx, *run)
if err != nil {
logger.Fatalf(err.Error())
shutdown.ShutdownAndExit(1, err.Error())
return
}

if action == nil {
logger.Errorf("No actions to run")
shutdown.ShutdownAndExit(1, err.Error())
return
}

Expand Down
5 changes: 0 additions & 5 deletions playbook/runner/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ func CreateTemplateEnv(ctx context.Context, playbook *models.Playbook, run *mode
}
}

// We are just crafting the template for param rendering
if run.ID == uuid.Nil {
return templateEnv, nil
}

if gitOpsEnvVar, err := getGitOpsTemplateVars(ctx, *run, spec.Actions); err != nil {
return templateEnv, oops.Wrapf(err, "failed to get gitops vars")
} else if gitOpsEnvVar != nil {
Expand Down

0 comments on commit 48b5162

Please sign in to comment.