-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ntampakas/main
AWS ECS deployment
- Loading branch information
Showing
6 changed files
with
67 additions
and
117 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,16 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
ISSUER_URL="https://issuer.anon-aadhaar.pse.dev" | ||
|
||
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 490752553772.dkr.ecr.eu-central-1.amazonaws.com | ||
|
||
docker build --build-arg "NEXT_PUBLIC_ISSUER_URL=$ISSUER_URL" -t anon-aadhaar-client -f client/Dockerfile client | ||
docker tag anon-aadhaar-client:latest 490752553772.dkr.ecr.eu-central-1.amazonaws.com/anon-aadhaar-client:latest | ||
docker push 490752553772.dkr.ecr.eu-central-1.amazonaws.com/anon-aadhaar-client:latest | ||
|
||
docker build -t anon-aadhaar-issuer . | ||
docker tag anon-aadhaar-issuer:latest 490752553772.dkr.ecr.eu-central-1.amazonaws.com/anon-aadhaar-issuer:latest | ||
docker push 490752553772.dkr.ecr.eu-central-1.amazonaws.com/anon-aadhaar-issuer:latest | ||
|
||
exit 0 |
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,13 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
tasks="anon-aadhaar-client anon-aadhaar-issuer" | ||
for task in $tasks; do | ||
anon_aadhaar_revision=$(aws ecs describe-task-definition --task-definition $task --query "taskDefinition.revision") | ||
aws ecs update-service --cluster anon-aadhaar --service $task --force-new-deployment --task-definition $task:$anon_aadhaar_revision | ||
done | ||
|
||
for loop in {1..3}; do | ||
[ "$loop" -eq 3 ] && exit 1 | ||
aws ecs wait services-stable --cluster anon-aadhaar --services $tasks && break || continue | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Deploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: arn:aws:iam::490752553772:role/privado-frontend-ecs-deploy-slc | ||
role-duration-seconds: 2700 | ||
aws-region: eu-central-1 | ||
|
||
- name: Build and Push images to ECR | ||
run: | | ||
.github/scripts/build.sh | ||
- name: Trigger ECS Deployment | ||
run: | | ||
.github/scripts/deploy.sh |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM node:21 | ||
RUN apt-get update ; apt-get install -y netcat-openbsd | ||
|
||
WORKDIR /app | ||
|
||
|