Skip to content
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
28 changes: 23 additions & 5 deletions .github/workflows/dsf_poc_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,16 @@ jobs:
mv $EXAMPLE_DIR/cm.tf{,_}
mv $EXAMPLE_DIR/cte_ddc_agents.tf{,_}
mv $EXAMPLE_DIR/fam_classification_integration_resources.tf{,_}
terraform -chdir=$EXAMPLE_DIR destroy -var dam_license=license.mprv -auto-approve

# Try destroy first
if ! terraform -chdir=$EXAMPLE_DIR destroy -var dam_license=license.mprv -auto-approve; then
echo "First destroy attempt failed, trying to remove ciphertrust_trial_license state"
# Try to remove the state, but don't fail if this doesn't work
terraform -chdir=$EXAMPLE_DIR state rm ciphertrust_trial_license.trial_license || true
# Retry destroy
terraform -chdir=$EXAMPLE_DIR destroy -var dam_license=license.mprv -auto-approve
fi

mv $EXAMPLE_DIR/main.tf{_,}
mv $EXAMPLE_DIR/outputs.tf{_,}
mv $EXAMPLE_DIR/dam.tf{_,}
Expand Down Expand Up @@ -319,11 +328,20 @@ jobs:
if: always()
run: |
if [ '${{ steps.apply.conclusion }}' == 'success' ] || [ ${{ github.event_name }} != 'schedule' ]; then
# Try destroy first
if [ -n "${{ env.DEPLOYMENT_VERSION }}" && ${{ env.DEPLOYMENT_VERSION }} != $'\n' ]; then
terraform -chdir=$EXAMPLE_DIR destroy -var dam_license=license.mprv -var ${{ env.DEPLOYMENT_VERSION }} -auto-approve
else
terraform -chdir=$EXAMPLE_DIR destroy -var dam_license=license.mprv -auto-approve
fi
DESTROY_CMD="terraform -chdir=$EXAMPLE_DIR destroy -var dam_license=license.mprv -var ${{ env.DEPLOYMENT_VERSION }} -auto-approve"
else
DESTROY_CMD="terraform -chdir=$EXAMPLE_DIR destroy -var dam_license=license.mprv -auto-approve"
fi

if ! eval $DESTROY_CMD; then
echo "First destroy attempt failed, trying to remove ciphertrust_trial_license state"
# Try to remove the state, but don't fail if this doesn't work
terraform -chdir=$EXAMPLE_DIR state rm ciphertrust_trial_license.trial_license || true
# Retry destroy
eval $DESTROY_CMD
fi
fi

- name: Terraform Delete Workspace
Expand Down
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,18 @@ myip-default
__pycache__/
upgrade_status.json
.coverage
*.log
venv/
.venv/
env/
.env/
*.pyc
*.pyo
*.pyd
.Python/
build/
dist/
*.egg-info/
*.dist-info/
*
!*/