Skip to content

Commit

Permalink
first draft
Browse files Browse the repository at this point in the history
  • Loading branch information
smonero committed Mar 19, 2024
1 parent 43dc515 commit 1475bb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion server/neptune/adhoc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ type AdhocTerraformWorkflowExecutionParams struct {
DeploymentID string
Root terraform.Root
Repo ghClient.Repo
// TODO: in separate PR, fill in github.Repo and terraform.Root (need helper funcs to get those)
}

// This function constructs the request we want to send to the temporal client,
Expand Down
9 changes: 4 additions & 5 deletions server/neptune/workflows/internal/terraform/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,6 @@ func (r *Runner) run(ctx workflow.Context) (Response, error) {
return Response{}, r.toExternalError(err, "fetching root")
}

// if we are in adhoc / terraform admin mode, we don't need to cleanup, plan, validate, or apply
if r.Request.WorkflowMode == terraform.Adhoc {
return Response{}, nil
}

defer func() {
r.executeCleanup(ctx, cleanup)
}()
Expand All @@ -357,6 +352,10 @@ func (r *Runner) run(ctx workflow.Context) (Response, error) {
return Response{}, r.toExternalError(err, "running plan job")
}

if r.Request.WorkflowMode == terraform.Adhoc {
return Response{}, nil
}

if r.Request.WorkflowMode == terraform.PR {
validationResults, err := r.Validate(ctx, root, response.ServerURL, planResponse.PlanJSONFile)
if err != nil {
Expand Down

0 comments on commit 1475bb8

Please sign in to comment.