Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: make deployment status explicit for test step trigger debug #409

Merged
merged 1 commit into from
Oct 25, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ jobs:

test_dev:
name: Run Tests on DEV
if: ${{ needs.terraform_env_dev.outputs.deploy_success == 'true' }}
needs:
- terraform_env_dev
uses: dvsa/vol-functional-tests/.github/workflows/e2eSmoke.yaml@main
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/deploy-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ on:
terraform-output:
description: "Terraform output"
value: ${{ jobs.deploy.outputs.terraform-output }}
deploy_success:
description: "Whether the deployment succeeded"
value: ${{ jobs.deploy.outputs.deploy_success }}
previous_api_image_tag:
description: "Previous API image tag"
value: ${{ jobs.deploy.outputs.previous_api_image_tag }}
Expand Down Expand Up @@ -118,6 +121,7 @@ jobs:
environment:
name: ${{ (inputs.apply && !inputs.destroy) && (inputs.workspace || inputs.environment) || null }}
outputs:
deploy_success: ${{ steps.deployment-status.outputs.success }}
terraform-output: ${{ steps.terraform-output.outputs.json }}
previous_api_image_tag: ${{ steps.get_current_versions.outputs.api_image_tag }}
previous_cli_image_tag: ${{ steps.get_current_versions.outputs.cli_image_tag }}
Expand Down Expand Up @@ -293,6 +297,21 @@ jobs:
TF_VAR_assets_version: ${{ inputs.assets-version }}
run: terraform apply ${{ inputs.destroy && '-destroy ' || '' }} -no-color -input=false -auto-approve ${{ inputs.terraform-args || '' }}

- name: Record Deployment Status
id: deployment-status
if: ${{ always() }}
run: |
if [[ "${{ inputs.apply }}" == "true" ]]; then
if [[ "${{ steps.apply.outcome }}" == "success" ]]; then
echo "success=true" >> $GITHUB_OUTPUT
else
echo "success=false" >> $GITHUB_OUTPUT
fi
else
# If this was just a plan, consider it successful
echo "success=true" >> $GITHUB_OUTPUT
fi

- name: Delete workspace
if: ${{ inputs.apply && inputs.destroy && inputs.workspace }}
run: terraform workspace select default && terraform workspace delete ${{ inputs.workspace }}
Expand Down
2 changes: 1 addition & 1 deletion app/internal/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ phpcs.xml
phpstan.neon
phpunit.xml
psalm.xml
# Trigger CD - 2024-10-25-1020
# Trigger CD - 2024-10-25-1115

Loading