Skip to content

Commit

Permalink
Stage and Prod pipeline implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheetal-ayanworks committed Jun 12, 2024
1 parent d4c0f53 commit a98373d
Show file tree
Hide file tree
Showing 52 changed files with 89 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev-agent-provisioning.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy AGENT_PROVISIONING app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-agent.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy AGENT app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-api-gateway.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy API-GATEWAY app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-connection.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy CONNECTION app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-ecosystem.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy ECOSYSTEM app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-issuance.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy ISSUANCE app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-ledger.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy LEDGER app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-notification.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy NOTIFICATION app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-organization.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy ORGANIZATION app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-user.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy USER app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-utility.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy UTILITY app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-verification.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy VERIFICATION app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-webhook.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy WEBHOOK app to DEV ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-agent-provisioning.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy AGENT_PROVISIONING app to PROD ECS


on:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/prod-agent.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy AGENT app to PROD ECS

on:
push:
Expand All @@ -7,7 +7,7 @@ on:


env:
ECR_IMAGE_TAG: "USER_v_${{ github.run_number }}"
ECR_IMAGE_TAG: "AGENT_V_${{ github.run_number }}"
ECR_REPOSITORY: "prod-services"
AWS_REGION: "ap-southeast-1"
CLUSTER: "PROD-NGOTAG-CLUSTER"
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: prod-services
IMAGE_TAG: "USER_V_${{ github.run_number }}"
IMAGE_TAG: "AGENT_V_${{ github.run_number }}"
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfiles/Dockerfile.agent-service .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
Expand All @@ -50,7 +50,7 @@ jobs:
run: |
echo "ECR_REGISTRY=${{ steps.login-ecr.outputs.registry }}" >> $GITHUB_ENV
echo "ECR_REPOSITORY=prod-services" >> $GITHUB_ENV
echo "IMAGE_TAG=USER_V_${{ github.run_number }}" >> $GITHUB_ENV
echo "IMAGE_TAG=AGENT_V_${{ github.run_number }}" >> $GITHUB_ENV
- name: Print environment variables
run: |
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/prod-api-gateway.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Build and deploy Node.js app to ECSsdc

name: Build and deploy API-GATEWAY app to PROD ECS
on:
push:
tags:
- 'prod-api-gateway*'


env:
ECR_IMAGE_TAG: "AGENT_V_${{ github.run_number }}"
ECR_IMAGE_TAG: "API-GATEWAY_V_${{ github.run_number }}"
ECR_REPOSITORY: "prod-services"
AWS_REGION: "ap-southeast-1"
CLUSTER: "PROD-NGOTAG-CLUSTER"
Expand Down Expand Up @@ -40,7 +39,7 @@ jobs:
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: prod-services
IMAGE_TAG: "AGENT_V_${{ github.run_number }}"
IMAGE_TAG: "API-GATEWAY_V_${{ github.run_number }}"
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfiles/Dockerfile.api-gateway .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
Expand All @@ -50,7 +49,7 @@ jobs:
run: |
echo "ECR_REGISTRY=${{ steps.login-ecr.outputs.registry }}" >> $GITHUB_ENV
echo "ECR_REPOSITORY=prod-services" >> $GITHUB_ENV
echo "IMAGE_TAG=AGENT_V_${{ github.run_number }}" >> $GITHUB_ENV
echo "IMAGE_TAG=API-GATEWAY_V_${{ github.run_number }}" >> $GITHUB_ENV
- name: Print environment variables
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-connection.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy CONNECTION app to PROD ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-ecosystem.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy ECOSYSTEM app to PROD ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-issuance.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy ISSUANCE app to PROD ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-ledger.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy LEDGER app to PROD ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-notification.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy NOTIFICATION app to PROD ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-organization.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy ORGANIZATION app to PROD ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-user.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy USER app to PROD ECS

on:
push:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/prod-utility.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy UTILITY app to PROD ECS


on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-verification.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy VERIFICATION app to PROD ECS

on:
push:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/prod-webhook.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy WEBHOOK app to PROD ECS

on:
push:
Expand All @@ -7,7 +7,7 @@ on:


env:
ECR_IMAGE_TAG: "VERIFICATION_V_${{ github.run_number }}"
ECR_IMAGE_TAG: "WEBHOOK_V_${{ github.run_number }}"
ECR_REPOSITORY: "prod-services"
AWS_REGION: "ap-southeast-1"
CLUSTER: "PROD-NGOTAG-CLUSTER"
Expand Down Expand Up @@ -40,17 +40,17 @@ jobs:
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: prod-services
IMAGE_TAG: "VERIFICATION_V_${{ github.run_number }}"
IMAGE_TAG: "WEBHOOK_V_${{ github.run_number }}"
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfiles/Dockerfile.verification .
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfiles/Dockerfile.webhook .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker image list
- name: Set environment variables
run: |
echo "ECR_REGISTRY=${{ steps.login-ecr.outputs.registry }}" >> $GITHUB_ENV
echo "ECR_REPOSITORY=prod-services" >> $GITHUB_ENV
echo "IMAGE_TAG=VERIFICATION_V_${{ github.run_number }}" >> $GITHUB_ENV
echo "IMAGE_TAG=WEBHOOK_V_${{ github.run_number }}" >> $GITHUB_ENV
- name: Print environment variables
run: |
Expand All @@ -65,16 +65,16 @@ jobs:
- name: Replace executionRoleArn in task definition
run: |
sed -i "s#\"executionRoleArn\": \"arn:aws:iam::.*:role/ecsTaskExecutionRole\"#\"executionRoleArn\": \"arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/ecsTaskExecutionRole\"#" prod-taskdef/verification-service.json
sed -i "s#\"executionRoleArn\": \"arn:aws:iam::.*:role/ecsTaskExecutionRole\"#\"executionRoleArn\": \"arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/ecsTaskExecutionRole\"#" prod-taskdef/webhook-service.json
- name: Update Task Definition and service
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/verification-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/verification-service.json)
SERVICE_NAME="${NAME}_service"
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/webhook-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/webhook-service.json)
SERVICE_NAME="${NAME}-service"
# Replace placeholders in the JSON file
sed -e "s;%BUILD_NUMBER%;${{ github.run_number }};g" -e "s;%REPOSITORY_URI%;${REPOSITORY_URI};g" prod-taskdef/verification-service.json > ${GITHUB_WORKSPACE}/${NAME}-v_${{ github.run_number }}.json
sed -e "s;%BUILD_NUMBER%;${{ github.run_number }};g" -e "s;%REPOSITORY_URI%;${REPOSITORY_URI};g" prod-taskdef/webhook-service.json > ${GITHUB_WORKSPACE}/${NAME}-v_${{ github.run_number }}.json
# Debug: Print the content of the modified JSON file
cat ${GITHUB_WORKSPACE}/${NAME}-v_${{ github.run_number }}.json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-agent-provisioning.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy AGENT_PROVISIONING app to QA ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-agent.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy AGENT app to QA ECS


on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-api-gateway.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy API-GATEWAY app to QA ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-connection.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy CONNECTION app to QA ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-ecosystem.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy ECOSYSTEM app to QA ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-issuance.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy ISSUANCE app to QA ECS


on:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qa-ledger.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy LEDGER app to QA ECS

on:
push:
tags:
- 'qa-ledger*'

env:
ECR_IMAGE_TAG: "ECOSYSTEM_V_${{ github.run_number }}"
ECR_IMAGE_TAG: "LEDGER_V_${{ github.run_number }}"
ECR_REPOSITORY: "qa-services"
AWS_REGION: "ap-southeast-1"
CLUSTER: "QA-NGOTAG-CLUSTER"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-notification.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy NOTIFICATION app to QA ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-organization.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy ORGANIZATION app to QA ECS

on:
push:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qa-user.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy USER app to QA ECS

on:
push:
tags:
- 'qa-user*'

env:
ECR_IMAGE_TAG: "USER_v_${{ github.run_number }}"
ECR_IMAGE_TAG: "USER_V_${{ github.run_number }}"
ECR_REPOSITORY: "qa-services"
AWS_REGION: "ap-southeast-1"
CLUSTER: "QA-NGOTAG-CLUSTER"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-utility.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy UTILITY app to QA ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-verification.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy VERIFICATION app to QA ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-webhook.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy WEBHOOK app to QA ECS

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stage-agent-provisioning.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy AGENT_PROVISIONING app to Stage ECS

on:
push:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/stage-agent.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build and deploy Node.js app to ECSsdc
name: Build and deploy AGENT app to Stage ECS

on:
push:
tags:
- 'stage-agent-service*'

env:
ECR_IMAGE_TAG: "USER_v_${{ github.run_number }}"
ECR_IMAGE_TAG: "AGENT_V_${{ github.run_number }}"
ECR_REPOSITORY: "stage-services"
AWS_REGION: "ap-southeast-1"
CLUSTER: "STAGE-NGOTAG-CLUSTER"
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: stage-services
IMAGE_TAG: "USER_V_${{ github.run_number }}"
IMAGE_TAG: "AGENT_V_${{ github.run_number }}"
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfiles/Dockerfile.agent-service .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
Expand All @@ -49,7 +49,7 @@ jobs:
run: |
echo "ECR_REGISTRY=${{ steps.login-ecr.outputs.registry }}" >> $GITHUB_ENV
echo "ECR_REPOSITORY=stage-services" >> $GITHUB_ENV
echo "IMAGE_TAG=USER_V_${{ github.run_number }}" >> $GITHUB_ENV
echo "IMAGE_TAG=AGENT_V_${{ github.run_number }}" >> $GITHUB_ENV
- name: Print environment variables
run: |
Expand Down
Loading

0 comments on commit a98373d

Please sign in to comment.