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

Fix: [AEA-0000] - flag to enable deploying cpsu #373

Merged
merged 2 commits into from
Jun 11, 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
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
with:
asdf_branch: v0.11.3

- name: Cache asdf
uses: actions/cache@v4
with:
Expand All @@ -55,8 +55,8 @@ jobs:
with:
asdf_branch: v0.11.3
env:
PYTHON_CONFIGURE_OPTS: --enable-shared
PYTHON_CONFIGURE_OPTS: --enable-shared

- name: Install node packages
run: |
make install-node
Expand Down Expand Up @@ -111,6 +111,7 @@ jobs:
CREATE_PROD_RELEASE_NOTES: true
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: false
DEPLOY_APIGEE_CPSU: true
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}
DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
Expand All @@ -135,6 +136,7 @@ jobs:
LOG_RETENTION_DAYS: 30
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: false
DEPLOY_APIGEE_CPSU: true
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}

Expand All @@ -155,5 +157,6 @@ jobs:
LOG_RETENTION_DAYS: 30
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: false
DEPLOY_APIGEE_CPSU: true
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.QA_CLOUD_FORMATION_DEPLOY_ROLE }}
2 changes: 2 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
LOG_RETENTION_DAYS: 30
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: false
DEPLOY_APIGEE_CPSU: true
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}

Expand All @@ -94,5 +95,6 @@ jobs:
LOG_RETENTION_DAYS: 30
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: false
DEPLOY_APIGEE_CPSU: false
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}
44 changes: 36 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
with:
asdf_branch: v0.11.3

- name: Cache asdf
uses: actions/cache@v4
with:
Expand All @@ -54,8 +54,8 @@ jobs:
with:
asdf_branch: v0.11.3
env:
PYTHON_CONFIGURE_OPTS: --enable-shared
PYTHON_CONFIGURE_OPTS: --enable-shared

- name: Install node packages
run: |
make install-node
Expand All @@ -77,7 +77,7 @@ jobs:
echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_ENV"
env:
GITHUB_TOKEN: ${{ github.token }}

- name: tag release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
[Release workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})

It was initialized by [${{ github.event.sender.login }}](${{ github.event.sender.html_url }})

package_code:
needs: tag_release
uses: ./.github/workflows/sam_package_code.yml
Expand All @@ -130,6 +130,7 @@ jobs:
CREATE_PROD_RELEASE_NOTES: true
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: false
DEPLOY_APIGEE_CPSU: true
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}
DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
Expand All @@ -154,11 +155,19 @@ jobs:
LOG_RETENTION_DAYS: 30
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: false
DEPLOY_APIGEE_CPSU: true
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}

release_ref:
needs: [tag_release, release_dev, release_dev_sandbox, package_code, get_commit_id]
needs:
[
tag_release,
release_dev,
release_dev_sandbox,
package_code,
get_commit_id,
]
uses: ./.github/workflows/sam_release_code.yml
with:
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}
Expand All @@ -175,11 +184,19 @@ jobs:
LOG_RETENTION_DAYS: 30
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: true
DEPLOY_APIGEE_CPSU: true
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.REF_CLOUD_FORMATION_DEPLOY_ROLE }}

release_qa:
needs: [tag_release, release_dev, release_dev_sandbox, package_code, get_commit_id]
needs:
[
tag_release,
release_dev,
release_dev_sandbox,
package_code,
get_commit_id,
]
uses: ./.github/workflows/sam_release_code.yml
with:
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}
Expand All @@ -196,6 +213,7 @@ jobs:
LOG_RETENTION_DAYS: 30
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: false
DEPLOY_APIGEE_CPSU: true
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.QA_CLOUD_FORMATION_DEPLOY_ROLE }}

Expand All @@ -219,6 +237,7 @@ jobs:
CREATE_INT_RC_RELEASE_NOTES: true
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: false
DEPLOY_APIGEE_CPSU: false
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.INT_CLOUD_FORMATION_DEPLOY_ROLE }}
DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
Expand All @@ -243,11 +262,19 @@ jobs:
LOG_RETENTION_DAYS: 30
DEPLOY_APIGEE: true
DYNAMODB_AUTOSCALE: false
DEPLOY_APIGEE_CPSU: false
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.INT_CLOUD_FORMATION_DEPLOY_ROLE }}

release_prod:
needs: [tag_release, release_int, release_int_sandbox, package_code, get_commit_id]
needs:
[
tag_release,
release_int,
release_int_sandbox,
package_code,
get_commit_id,
]
uses: ./.github/workflows/sam_release_code.yml
with:
ARTIFACT_BUCKET_PREFIX: ${{needs.tag_release.outputs.version_tag}}
Expand All @@ -266,6 +293,7 @@ jobs:
CREATE_PROD_RELEASE_NOTES: true
DEPLOY_APIGEE: false
DYNAMODB_AUTOSCALE: true
DEPLOY_APIGEE_CPSU: false
secrets:
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.PROD_CLOUD_FORMATION_DEPLOY_ROLE }}
DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/sam_release_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ on:
DYNAMODB_AUTOSCALE:
type: boolean
default: true
DEPLOY_APIGEE_CPSU:
type: boolean
default: true
secrets:
CLOUD_FORMATION_DEPLOY_ROLE:
required: true
Expand All @@ -69,7 +72,7 @@ on:
required: false
DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE:
required: false

jobs:
sam_release_code:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -123,13 +126,13 @@ jobs:
with:
name: python_dependency_files
path: .

# using git commit sha for version of action to ensure we have stable version
- name: Install asdf
uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
with:
asdf_branch: v0.11.3

- name: Cache asdf
uses: actions/cache@v4
with:
Expand All @@ -149,7 +152,7 @@ jobs:
- name: Run make install-python
run: |
make install-python

- name: Export specification paths
run: |
SPEC_PATH="$(pwd)/eps-prescription-status-update-api.resolved.json"
Expand Down Expand Up @@ -195,11 +198,11 @@ jobs:
AWS_ENVIRONMENT: ${{ inputs.AWS_ENVIRONMENT }}
APIGEE_ENVIRONMENT: ${{ inputs.APIGEE_ENVIRONMENT }}
run: poetry run ./deploy_api.sh

- name: Deploy CPSU API
shell: bash
working-directory: .github/scripts
if: ${{ inputs.DEPLOY_APIGEE == true && always() && !failure() && !cancelled() }}
if: ${{ inputs.DEPLOY_APIGEE_CPSU == true && always() && !failure() && !cancelled() }}
env:
API_TYPE: custom
VERSION_NUMBER: ${{ inputs.VERSION_NUMBER }}
Expand Down Expand Up @@ -244,7 +247,7 @@ jobs:
with:
ref: gh-pages
path: gh-pages

- name: Update release tag in github pages
if: ${{ !startsWith(inputs.STACK_NAME, 'psu-pr-') }}
run: |
Expand Down