Skip to content

Commit

Permalink
Feat: add debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollorion committed Jun 6, 2024
1 parent c4a3eaa commit faa6eca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spacemk/commands/import_state_files_to_spacelift.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,20 @@ def _create_context(spacelift: Spacelift, space_id: str, token: str):
"https://app.terraform.io/api/v2/workspaces/${TF_WORKSPACE_ID}/current-state-version" \
| jq -r '.data.attributes."hosted-state-download-url"' )
echo "Downloading state file from $STATE_DOWNLOAD_URL"
curl --fail \
--header "Authorization: Bearer $TF_TOKEN" \
--location \
--output state.tfstate \
--show-error \
--silent \
"${STATE_DOWNLOAD_URL}"
echo "Uploading state file to Spacelift"
terraform state push -force state.tfstate
echo "State pushed successfully"
"""

variables = {
Expand Down

0 comments on commit faa6eca

Please sign in to comment.