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

Dat 16824 #212

Merged
merged 48 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
abf6148
🔧 (ephemeral-cloud-infra.yml): add GitHub Actions workflow for managi…
May 23, 2024
d82730b
🔧 (.github/workflows/ephemeral-cloud-infra.yml): update branch refere…
May 23, 2024
761403a
🔧 (.github/workflows/ephemeral-cloud-infra.yml): update GITHUB_TOKEN …
May 23, 2024
01fee40
🔧 (ephemeral-cloud-infra.yml): update Terraform Format job to include…
May 23, 2024
5567e88
🔧 (ephemeral-cloud-infra.yml): remove unnecessary working-directory f…
May 23, 2024
a34dd5d
🔧 (ephemeral-cloud-infra.yml): remove Terraform Format and Terraform …
May 23, 2024
84f3b53
🔧 (.github/workflows/ephemeral-cloud-infra.yml): add TF_VAR prefix to…
May 23, 2024
6cfb844
🔧 (ephemeral-cloud-infra.yml): remove unnecessary TF_VAR_ prefix from…
May 23, 2024
0cd676d
🔧 (ephemeral-cloud-infra.yml): update workflow to create and destroy …
May 23, 2024
20b2f72
🔧 (ephemeral-cloud-infra.yml): update destroy command to use spacectl…
May 23, 2024
c99a51d
🔧 (ephemeral-cloud-infra.yml): add support for deploying or destroyin…
May 23, 2024
baacc73
🔧 (ephemeral-cloud-infra.yml): Update workflow inputs to include 'des…
May 23, 2024
1225cde
🔧 (ephemeral-cloud-infra.yml): Update workflow inputs to include a de…
May 23, 2024
5a01e84
🔧 (.github/workflows/ephemeral-cloud-infra.yml): add support for spec…
May 23, 2024
e37be7b
🔧 (ephemeral-cloud-infra.yml): add output for EPHEMERAL_STACK_ID to a…
May 23, 2024
dc5c14e
🔧 (ephemeral-cloud-infra.yml): update output variable name from EPHEM…
May 23, 2024
3569df4
📝 (.github/workflows/ephemeral-cloud-infra.yml): add output for stack…
May 23, 2024
2f2a51e
🔧 (.github/workflows/ephemeral-cloud-infra.yml): add TF_VAR_create_dy…
May 23, 2024
5f2f0e7
🔧 (ephemeral-cloud-infra.yml): add upload and download steps for Terr…
May 23, 2024
f1de42a
🔧 (ephemeral-cloud-infra.yml): set TF_VAR_stack_id environment variab…
May 23, 2024
042b401
🔧 (ephemeral-cloud-infra.yml): add AWS credentials configuration step…
May 23, 2024
f5ba139
🔧 (.github/workflows/ephemeral-cloud-infra.yml): update AWS role ARN …
May 23, 2024
2f8a16f
🔧 (ephemeral-cloud-infra.yml): update permissions for job to improve …
May 23, 2024
61f690a
🔧 (.github/workflows/ephemeral-cloud-infra.yml): update AWS role ARN …
May 23, 2024
e8e4606
🔧 (.github/workflows/ephemeral-cloud-infra.yml): update AWS_DEV_GITHU…
May 24, 2024
b1373df
🔧 (.github/workflows/ephemeral-cloud-infra.yml): update AWS role ARN …
May 24, 2024
d5742b5
🔧 (ephemeral-cloud-infra.yml): comment out TF_VAR_create_dynamodb to …
May 24, 2024
9fe8212
🔧 (.github/workflows/ephemeral-cloud-infra.yml): add support for sett…
May 24, 2024
e0da684
🔧 (ephemeral-cloud-infra.yml): remove commented out TF_VAR_create_dyn…
May 24, 2024
068669c
🔧 (.github/workflows/ephemeral-cloud-infra.yml): add setting TF_VAR_s…
May 24, 2024
187b67a
🔧 (ephemeral-cloud-infra.yml): refactor setting TF_VAR_stack_id to us…
May 24, 2024
6906894
🐛 (ephemeral-cloud-infra.yml): fix the index used in the cut command …
May 24, 2024
60811bd
📝 (.github/workflows/ephemeral-cloud-infra.yml): update liquibase-inf…
May 24, 2024
c8ea120
📝 (.github/workflows/ephemeral-cloud-infra.yml): update description f…
May 24, 2024
f89a5e0
Merge branch 'main' into DAT-16824
jandroav May 24, 2024
463f6a5
Merge branch 'main' into DAT-16824
May 27, 2024
336e688
🔧 (.github/workflows/ephemeral-cloud-infra.yml): remove unnecessary c…
May 27, 2024
bbbee08
🔧 (ephemeral-cloud-infra.yml): convert extracted ID to uppercase for …
May 27, 2024
e1cbcfa
📝 (ephemeral-cloud-infra.yml): Add ephemeral-cloud-infra workflow for…
May 27, 2024
79f6778
🔧 (ephemeral-cloud-infra.yml): upgrade actions/upload-artifact and ac…
May 27, 2024
b15b4cd
🔧 (ephemeral-cloud-infra.yml): add support for deploying or destroyin…
May 27, 2024
bbdf84a
📝 (.github/workflows/ephemeral-cloud-infra.yml): update checkout acti…
May 27, 2024
300b829
📝 (ephemeral-cloud-infra.yml): update checkout ref from DAT-16824 to …
May 27, 2024
85e54e4
📝 (.github/workflows/ephemeral-cloud-infra.yml): update checkout acti…
May 28, 2024
9a1411b
🔧 (ephemeral-cloud-infra.yml): remove unnecessary conversion to upper…
May 28, 2024
6dc6148
🔧 (ephemeral-cloud-infra.yml): convert extracted ID to uppercase for …
May 28, 2024
0a89dc2
🔧 (ephemeral-cloud-infra.yml): remove unnecessary conversion to upper…
May 28, 2024
9c1d751
🔧 (ephemeral-cloud-infra.yml): update terraform destroy command to in…
May 28, 2024
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
23 changes: 15 additions & 8 deletions .github/workflows/ephemeral-cloud-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ on:
required: false
type: boolean
dynamodb:
description: 'Deploy or destroy the dynamodb table'
description: 'Deploy or destroy the dynamodb infrastructure'
required: false
type: boolean
default: false
documentdb:
description: 'Deploy or destroy the documentdb infrastructure'
required: false
type: boolean
default: false
stack_id:
description: 'The stack ID to destroy'
required: false
Expand All @@ -36,8 +41,8 @@ jobs:
contents: read
id-token: write
outputs:
stack_id: ${{ steps.create_stack.outputs.stack_id }}
resources_id: ${{ steps.create_infra.outputs.resources_id }}
stack_id: ${{ steps.create_stack.outputs.stack_id }} # Used to reference the stack created in the ephemeral infra
resources_id: ${{ steps.create_infra.outputs.resources_id }} # Used to reference the resources created in the ephemeral infra
env:
SPACELIFT_API_KEY_ENDPOINT: ${{ secrets.SPACELIFT_API_KEY_ENDPOINT }}
SPACELIFT_API_KEY_ID: ${{ secrets.SPACELIFT_API_KEY_ID }}
Expand All @@ -47,7 +52,7 @@ jobs:
- name: Checkout liquibase-infrastructure
uses: actions/checkout@v4
with:
ref: master
ref: DAT-16824
repository: liquibase/liquibase-infrastructure
token: ${{ secrets.BOT_TOKEN }}

Expand Down Expand Up @@ -78,7 +83,7 @@ jobs:

- name: Upload Terraform state as artifact
if: ${{ inputs.deploy }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: terraform-state
path: test-automation-ephemeral/stack/terraform.tfstate
Expand All @@ -88,23 +93,25 @@ jobs:
working-directory: test-automation-ephemeral/infra
if: ${{ inputs.deploy }}
run: |
ID=$(echo ${{ steps.create_stack.outputs.stack_id }} | cut -d '-' -f 5 | tr '[:lower:]' '[:upper:]')
ID=$(echo ${{ steps.create_stack.outputs.stack_id }} | cut -d '-' -f 5)
echo "resources_id=$ID" >> "$GITHUB_OUTPUT"
spacectl stack environment setvar --id $EPHEMERAL_STACK_ID TF_VAR_stack_id $ID
spacectl stack environment setvar --id $EPHEMERAL_STACK_ID TF_VAR_create_dynamodb ${{ inputs.dynamodb }}
spacectl stack environment setvar --id $EPHEMERAL_STACK_ID TF_VAR_create_documentdb ${{ inputs.documentdb }}
spacectl stack deploy --id $EPHEMERAL_STACK_ID --auto-confirm

- name: Destroy ephemeral infra
continue-on-error: true
env:
TF_VAR_stack_id: ${{ inputs.stack_id }}
if: ${{ inputs.destroy }}
working-directory: test-automation-ephemeral/infra
run: |
spacectl stack task --id ${{ inputs.stack_id }} --tail "terraform destroy -auto-approve"
spacectl stack task --id ${{ inputs.stack_id }} --tail "terraform destroy -refresh=false -parallelism=10 -auto-approve"

- name: Download Terraform state
if: ${{ inputs.destroy }}
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: terraform-state
path: test-automation-ephemeral/stack
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Please review the below table of reusable workflows and their descriptions:
| `build-artifact.yml` | Runs maven build and saves artifacts |
| `codeql.yml` | Runs CodeQL scanning |
| `create-release.yml` | Runs Release Drafter to auto create draft release notes |
| `ephemeral-cloud-infra.yml` | Creates/Destroys test automation cloud infrastructure |
| `extension-attach-artifact-release.yml` | Attaches a tested artifact to the draft release. Receives a `zip` input to upload generated zip files |
| `extension-release-published.yml` | Publishes a release to Maven Central |
| `extension-update-version.yml` | Updates release and development `pom.xml` versions |
Expand Down