-
Notifications
You must be signed in to change notification settings - Fork 3
VED-809: Destroy Pipeline #860
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
Closed
Closed
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d4256fb
first draft for teardown pipeline
Akol125 efa6397
VED-809: Creating teardown pipeline in Github Actions
Akol125 8f347c1
VED-809: Creating teardown pipeline in Github Actions2
Akol125 8e5c290
Merge branch 'master' into VED-809-destroy-pipeline
dlzhry2nhs 092c701
fix ternary operator issue
Akol125 f48782d
Merge branch 'VED-809-destroy-pipeline' into VED-809-destroy-pipeline
Akol125 6944db7
fix indentation issue
Akol125 13a99db
Include workspace step in tf step
dlzhry2nhs be39563
teardown pipeline description example
Akol125 b5fa71e
Merge branch 'VED-809-destroy-pipeline' into VED-809-destroy-pipeline
Akol125 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: PR Teardown | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
| workflow_dispatch: | ||
| inputs: | ||
| pr_number: | ||
| description: The PR number of the environment to teardown | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| teardown: | ||
| name: PR Teardown | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: dev | ||
| env: | ||
| APIGEE_ENVIRONMENT: internal-dev | ||
| BACKEND_ENVIRONMENT: dev | ||
| BACKEND_SUB_ENVIRONMENT: pr-${{ github.event_name == 'pull_request' && github.event.pull_request.number || inputs.pr_number }} | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Connect to AWS | ||
| uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a | ||
| with: | ||
| aws-region: eu-west-2 | ||
| role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/auto-ops | ||
| role-session-name: github-actions | ||
|
|
||
| - name: Whoami | ||
| run: aws sts get-caller-identity | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | ||
|
|
||
| - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd | ||
| with: | ||
| terraform_version: "1.12.2" | ||
|
|
||
| - name: Terraform Init and extract MNS SQS QUEUE ARN | ||
| working-directory: ${{ vars.TERRAFORM_DIR_PATH }} | ||
| run: | | ||
| make init apigee_environment=$APIGEE_ENVIRONMENT environment=$BACKEND_ENVIRONMENT sub_environment=$BACKEND_SUB_ENVIRONMENT | ||
| make workspace apigee_environment=$APIGEE_ENVIRONMENT environment=$BACKEND_ENVIRONMENT sub_environment=$BACKEND_SUB_ENVIRONMENT | ||
| echo "ID_SYNC_QUEUE_ARN=$(make -s output name=id_sync_queue_arn)" >> $GITHUB_ENV | ||
|
|
||
| - name: Install poetry | ||
| run: pip install poetry==2.1.4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.11 | ||
| cache: 'poetry' | ||
|
|
||
| - name: Unsubscribe MNS | ||
| working-directory: './lambdas/mns_subscription' | ||
| env: | ||
| SQS_ARN: ${{ env.ID_SYNC_QUEUE_ARN }} | ||
| run: | | ||
| poetry install --no-root | ||
|
|
||
| echo "Unsubscribing SQS to MNS for notifications..." | ||
| make unsubscribe | ||
|
|
||
| - name: Terraform Destroy | ||
| working-directory: ${{ vars.TERRAFORM_DIR_PATH }} | ||
| run: | | ||
| make destroy apigee_environment=$APIGEE_ENVIRONMENT environment=$BACKEND_ENVIRONMENT sub_environment=$BACKEND_SUB_ENVIRONMENT | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth include an example at the end
e.g. 123. People might forget it needs to just be the number rather thanpr-123.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example should be 123, not pr-123