-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial opt-out-export workflows
- Loading branch information
Showing
8 changed files
with
192 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: opt-out-export dev deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: self-hosted | ||
environment: dev | ||
defaults: | ||
run: | ||
working-directory: ./attribution-data-file-share | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main | ||
env: | ||
AWS_REGION: ${{ vars.AWS_REGION }} | ||
with: | ||
params: | | ||
ARTIFACTORY_URL=/artifactory/url | ||
ARTIFACTORY_USER=/artifactory/user | ||
ARTIFACTORY_PASSWORD=/artifactory/password | ||
- name: Build opt-out-export zip file | ||
run: ../gradlew buildZip | ||
- uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/delegatedadmin/developer/ab2d-dev-github-actions | ||
- name: Upload and reload | ||
run: | | ||
aws s3 cp --no-progress build/distributions/attributionDataShare.zip \ | ||
s3://ab2d-dev-opt-out-export-function/function-${{ github.sha }}.zip | ||
aws lambda update-function-code --function-name ab2d-dev-opt-out-export \ | ||
--s3-bucket ab2d-dev-opt-out-export-function --s3-key function-${{ github.sha }}.zip |
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,24 @@ | ||
name: opt-out-export prod deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
permissions: | ||
contents: read | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
environment: prod | ||
steps: | ||
- uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/delegatedadmin/developer/ab2d-prod-github-actions | ||
- name: Promote lambda code from test to prod | ||
run: | | ||
aws s3 cp --no-progress \ | ||
s3://ab2d-test-opt-out-export-function/function-${{ github.sha }}.zip \ | ||
s3://ab2d-prod-opt-out-export-function/function-${{ github.sha }}.zip | ||
aws lambda update-function-code --function-name ab2d-prod-opt-out-export \ | ||
--s3-bucket ab2d-prod-opt-out-export-function --s3-key function-${{ github.sha }}.zip |
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,41 @@ | ||
name: opt-out-export test (impl) deploy | ||
|
||
on: | ||
push: | ||
paths: | ||
- attribution-data-file-share/** | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: self-hosted | ||
environment: test | ||
defaults: | ||
run: | ||
working-directory: ./attribution-data-file-share | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main | ||
env: | ||
AWS_REGION: ${{ vars.AWS_REGION }} | ||
with: | ||
params: | | ||
ARTIFACTORY_URL=/artifactory/url | ||
ARTIFACTORY_USER=/artifactory/user | ||
ARTIFACTORY_PASSWORD=/artifactory/password | ||
- name: Build opt-out-export zip file | ||
run: ../gradlew buildZip | ||
- uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/delegatedadmin/developer/ab2d-test-github-actions | ||
- name: Upload and reload | ||
run: | | ||
aws s3 cp --no-progress build/distributions/attributionDataShare.zip \ | ||
s3://ab2d-test-opt-out-export-function/function-${{ github.sha }}.zip | ||
aws lambda update-function-code --function-name ab2d-test-opt-out-export \ | ||
--s3-bucket ab2d-test-opt-out-export-function --s3-key function-${{ github.sha }}.zip |
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,26 @@ | ||
name: opt-out-export integration tests | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/opt-out-export-test-integration.yml | ||
- optout/** | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# TODO Deploy first if triggered by push | ||
trigger: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./attribution-data-file-share | ||
steps: | ||
- uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/delegatedadmin/developer/ab2d-test-github-actions | ||
- name: Upload test file to the BFD bucket | ||
run: | | ||
aws events put-events --entries file://test/events.json # TODO Add events.json matching rule for lambda trigger | ||
# TODO check bucket for export file |
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,33 @@ | ||
name: opt-out-export unit tests | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/opt-out-export-test-unit.yml | ||
- attribution-data-file-share/** | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: self-hosted | ||
defaults: | ||
run: | ||
working-directory: ./attribution-data-file-share | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main | ||
env: | ||
AWS_REGION: ${{ vars.AWS_REGION }} | ||
with: | ||
params: | | ||
ARTIFACTORY_URL=/artifactory/url | ||
ARTIFACTORY_USER=/artifactory/user | ||
ARTIFACTORY_PASSWORD=/artifactory/password | ||
SONAR_HOST_URL=/sonarqube/url | ||
SONAR_TOKEN=/sonarqube/token | ||
- name: Run unit tests for opt-out-export lambda | ||
run: ../gradlew test |
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
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,28 @@ | ||
name: opt-out-import integration tests | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/opt-out-import-test-integration.yml | ||
- optout/** | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# TODO Deploy first if triggered by push | ||
upload: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./optout | ||
steps: | ||
- uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
aws-region: ${{ vars.AWS_REGION }} | ||
# Note that we use the lambda role with access to the bucket | ||
role-to-assume: arn:aws:iam::${{ secrets.TEST_ACCOUNT_ID }}:role/delegatedadmin/developer/ab2d-test-opt-out-import-function | ||
- name: Upload test file to the BFD bucket | ||
run: | | ||
aws s3 cp --no-progress src/test/resources/optOutDummy.txt \ | ||
s3://bfd-test-eft/bfdeft01/ab2d/in/testing.txt | ||
# TODO Run another job to check database for update, then check bucket for response file |