-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a GitHub action to deploy the ingest inspector (#1130)
- Loading branch information
1 parent
cb733c8
commit 523e391
Showing
4 changed files
with
71 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,30 @@ | ||
name: Deploy Ingest Inspector | ||
on: | ||
push | ||
# push: | ||
# branches: | ||
# - main | ||
|
||
permissions: | ||
id-token: write | ||
|
||
jobs: | ||
deploy_ingest_inspector: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: eu-west-1 | ||
role-to-assume: ${{ secrets.DEPLOY_INGEST_INSPECTOR_GHA_ROLE_ARN }} | ||
- name: Deploy Ingest Inspector backend | ||
run: | | ||
pip3 install boto3 docopt | ||
python3 ./builds/publish_lambda_zip.py monitoring/ingest_inspector/backend_lambda \ | ||
--bucket=wellcomecollection-storage-infra \ | ||
--key=lambdas/monitoring/ingest_inspector_backend.zip | ||
./deploy_lambda_zip.sh monitoring/ingest_inspector_backend ingest_inspector_backend | ||
- name: Deploy Ingest Inspector frontend | ||
run: | | ||
cd monitoring/ingest_inspector/frontend | ||
sh deploy.sh |
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,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Usage: ./deploy_lambda_zip.sh <project_name> <lambda_name> | ||
# Example: ./deploy_lambda_zip.sh monitoring/ingest_inspector_backend ingest_inspector_backend | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
PROJECT_NAME=$1 | ||
LAMBDA_NAME=$2 | ||
|
||
S3_BUCKET="wellcomecollection-storage-infra" | ||
S3_KEY="lambdas/$PROJECT_NAME.zip" | ||
|
||
echo "Identifying function: $LAMBDA_NAME" | ||
FUNCTION_ARN=$(aws lambda get-function-configuration \ | ||
--function-name $LAMBDA_NAME \ | ||
--query "FunctionArn" \ | ||
--output text) | ||
|
||
echo "Updating function: $FUNCTION_ARN from s3://$S3_BUCKET/$S3_KEY" | ||
REVISION_ID=$(aws lambda update-function-code \ | ||
--function-name $LAMBDA_NAME \ | ||
--s3-bucket $S3_BUCKET \ | ||
--s3-key $S3_KEY \ | ||
--query "RevisionId" \ | ||
--output text) | ||
|
||
echo "Revision id: $REVISION_ID" | ||
|
||
echo "Awaiting function update" | ||
aws lambda wait function-updated \ | ||
--function-name $LAMBDA_NAME | ||
|
||
echo "Done" |
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