Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(playbook): allow git and env templating in params #1493

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading