-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove flyway files from layer (#576)
Remove flyway files from layer so they can be updated independently Create upload flyway files workflow similar to the athena files one Call upload flyway files workflow from run flyway command workflow Create S3 bucket, S3 policy and upload role in IaC similar to the athena files ones Add logic to run flyway command lambda to download flyway files from S3 and update the tests Make database a required parameter in the run flyway command workflow Add flyway.conf file and move migrations directory to new flyway files subdirectory of redshift-scripts Remove logic to copy migrations into layer in build flyway layer script Add new test to redshift rotate secret tests to increase coverage of database access logic Update layer and main READMEs to cover changes
- Loading branch information
1 parent
a24a2b6
commit 8c3fbcc
Showing
12 changed files
with
358 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,48 @@ | ||
name: ✳️ Upload Flyway files to S3 | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
type: string | ||
required: true | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: choice | ||
required: true | ||
description: AWS environment | ||
options: [DEV, TEST, FEATURE, BUILD, STAGING, INTEGRATION, PRODUCTION, PRODUCTION-PREVIEW] | ||
|
||
jobs: | ||
validate-environment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Validate input environment | ||
run: scripts/validate-environment.sh ${{ inputs.environment }} | ||
|
||
upload-to-s3: | ||
needs: [validate-environment] | ||
# These permissions are needed to interact with GitHub's OIDC Token endpoint (enabling the aws-actions/configure-aws-credentials action) | ||
permissions: | ||
id-token: write | ||
contents: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Assume AWS GitHub actions role | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: eu-west-2 | ||
role-to-assume: ${{ secrets.FLYWAY_FILES_UPLOAD_ROLE_ARN }} | ||
- name: Upload athena files to S3 | ||
run: | | ||
REGION="eu-west-2" | ||
FILES_ROOT="redshift-scripts/flyway" | ||
S3_BUCKET="s3://$(echo "${{ inputs.environment }}" | tr '[:upper:]' '[:lower:]')-dap-flyway-files" | ||
echo "Uploading contents of $FILES_ROOT to bucket $S3_BUCKET" | ||
aws --region="$REGION" s3 cp "$FILES_ROOT" "$S3_BUCKET" --recursive |
This file contains 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 |
---|---|---|
|
@@ -11,3 +11,4 @@ Dockerfile | |
*.sql | ||
*.jar | ||
*.tar.gz | ||
flyway.conf |
This file contains 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
This file contains 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
Empty file.
File renamed without changes.
This file contains 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
This file contains 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
Oops, something went wrong.