Skip to content

Commit

Permalink
Revert "fix: add Atmos commands to Spacelift custom workflow tool (#158
Browse files Browse the repository at this point in the history
…)" (#159)

This reverts commit 93f5234.
  • Loading branch information
mtweeman authored Oct 1, 2024
1 parent 93f5234 commit 21d543c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
18 changes: 9 additions & 9 deletions .spacelift/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Source: https://docs.spacelift.io/vendors/terraform/workflow-tool
# Used to initialize your root module.
init: atmos terraform init -input=false
init: terraform init -input=false

# Used to select the correct workspace. Only used for Stacks that are using a custom state
# backend, and which have the Workspace setting configured.
#
# Available template parameters:
# - .WorkspaceName - contains the name of the workspace to select.
workspaceSelect: atmos terraform workspace select "{{ .WorkspaceName }}"
workspaceSelect: terraform workspace select "{{ .WorkspaceName }}"

# Used to create a new workspace if none with the required name exists. Only used for Stacks
# that are using a custom state backend, and which have the Workspace setting configured.
#
# Available template parameters:
# - .WorkspaceName - contains the name of the workspace to select.
workspaceNew: atmos terraform workspace new "{{ .WorkspaceName }}"
workspaceNew: terraform workspace new "{{ .WorkspaceName }}"

# Used to generate a plan of the infrastructure changes that will be applied.
#
Expand All @@ -23,25 +23,25 @@ workspaceNew: atmos terraform workspace new "{{ .WorkspaceName }}"
# - .Refresh - whether state resources should be refreshed.
# - .PlanFileName - the name of the file to store the plan in.
# - .Targets - the list of targets to plan. Used during targeted replans.
plan: atmos terraform plan -input=false -lock={{ .Lock }} {{ if not .Refresh }}-refresh=false {{ end }}-out={{ .PlanFileName }} {{ range .Targets }}-target='{{ . }}' {{ end }}
plan: terraform plan -input=false -lock={{ .Lock }} {{ if not .Refresh }}-refresh=false {{ end }}-out={{ .PlanFileName }} {{ range .Targets }}-target='{{ . }}' {{ end }}

# Outputs the current state information as JSON.
showState: atmos terraform show -json
showState: terraform show -json

# Used to convert a plan file to its JSON representation.
#
# Available template parameters:
# - .PlanFileName - the name of the file containing the plan.
showPlan: atmos terraform show -json "{{ .PlanFileName }}"
showPlan: terraform show -json "{{ .PlanFileName }}"

# Used to get the current outputs from the state.
getOutputs: atmos terraform output -json
getOutputs: terraform output -json

# Used to apply any changes contained in the specified plan.
#
# Available template parameters:
# - .PlanFileName - the name of the file containing the plan.
apply: atmos terraform apply -auto-approve -input=false "{{ .PlanFileName }}"
apply: terraform apply -auto-approve -input=false "{{ .PlanFileName }}"

# Used to tear down any resources as part of deleting a stack.
destroy: atmos terraform destroy -auto-approve -input=false
destroy: terraform destroy -auto-approve -input=false
16 changes: 8 additions & 8 deletions stacks/catalog/spacelift/admin-stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ components:
spacelift:
administrative: true
autodeploy: true
# before_apply:
# - spacelift-configure-paths
# before_init:
# - spacelift-configure-paths
# - spacelift-write-vars
# - spacelift-tf-workspace
# before_plan:
# - spacelift-configure-paths
before_apply:
- spacelift-configure-paths
before_init:
- spacelift-configure-paths
- spacelift-write-vars
- spacelift-tf-workspace
before_plan:
- spacelift-configure-paths
drift_detection_enabled: true
drift_detection_reconcile: true
drift_detection_schedule:
Expand Down
18 changes: 8 additions & 10 deletions stacks/orgs/hs/_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,16 @@ terraform:
settings:
spacelift:
workspace_enabled: true # enable spacelift by default
# before_apply:
# - spacelift-configure-paths
# before_init:
# - spacelift-configure-paths
# - spacelift-write-varsclear

# - spacelift-tf-workspace
# before_plan:
# - spacelift-configure-paths
before_apply:
- spacelift-configure-paths
before_init:
- spacelift-configure-paths
- spacelift-write-vars
- spacelift-tf-workspace
before_plan:
- spacelift-configure-paths
labels:
- pr-comment-triggered
# - nobackend

vars:
namespace: hs

0 comments on commit 21d543c

Please sign in to comment.