From 3a6e5b4f47a2805e7af60500ce9d4815725ff369 Mon Sep 17 00:00:00 2001 From: Samra Belachew Date: Tue, 24 Oct 2023 10:56:27 -0700 Subject: [PATCH] support-deploywf --- server/neptune/gateway/deploy/signaler.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/server/neptune/gateway/deploy/signaler.go b/server/neptune/gateway/deploy/signaler.go index 163852c62..56dc012b2 100644 --- a/server/neptune/gateway/deploy/signaler.go +++ b/server/neptune/gateway/deploy/signaler.go @@ -18,6 +18,8 @@ type signaler interface { const ( Deprecated = "deprecated" Destroy = "-destroy" + Manifest = "manifest_path" + EnvStep = "env" ) type WorkflowSignaler struct { @@ -52,7 +54,7 @@ func (d *WorkflowSignaler) SignalWithStartWorkflow(ctx context.Context, rootCfg Root: workflows.Root{ Name: rootCfg.Name, Plan: workflows.Job{ - Steps: d.generateSteps(rootCfg.DeploymentWorkflow.Plan.Steps), + Steps: d.prependPlanEnvSteps(rootCfg), }, Apply: workflows.Job{ Steps: d.generateSteps(rootCfg.DeploymentWorkflow.Apply.Steps), @@ -94,6 +96,20 @@ func BuildDeployWorkflowID(repoName string, rootName string) string { return fmt.Sprintf("%s||%s", repoName, rootName) } +func (d *WorkflowSignaler) prependPlanEnvSteps(cfg *valid.MergedProjectCfg) []workflows.Step { + var steps []workflows.Step + if t, ok := cfg.Tags[Manifest]; ok { + //this is a Lyft specific env var + steps = append(steps, workflows.Step{ + StepName: EnvStep, + EnvVarName: "MANIFEST_FILEPATH", + EnvVarValue: t, + }) + } + steps = append(steps, d.generateSteps(cfg.DeploymentWorkflow.Plan.Steps)...) + return steps +} + func (d *WorkflowSignaler) generateSteps(steps []valid.Step) []workflows.Step { // NOTE: for deployment workflows, we won't support command level user requests for log level output verbosity var workflowSteps []workflows.Step