Skip to content

Commit

Permalink
Merge branch 'pipeline-implementation' into develop
Browse files Browse the repository at this point in the history
Signed-off-by: Ankita Patidar <[email protected]>
  • Loading branch information
ankita-p17 authored Jul 11, 2024
2 parents 5d051f4 + 9544142 commit e36cdf7
Show file tree
Hide file tree
Showing 135 changed files with 1,132 additions and 344 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
16 changes: 8 additions & 8 deletions .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 Expand Up @@ -69,8 +69,8 @@ jobs:
- name: Update Task Definition
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/agent-provisioning.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/agent-provisioning.json)
SERVICE_NAME="${NAME}_service"
SERVICE_NAME="agent-provisioning_service"
echo "SERVICE_NAME: ${SERVICE_NAME}"
# Replace placeholders in the JSON file
Expand All @@ -84,12 +84,12 @@ jobs:

- name: Update Task Definition and service
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/user-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/user-service.json)
SERVICE_NAME="${NAME}_service"
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/agent-provisioning.json)
SERVICE_NAME="agent-provisioning_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/user-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/agent-provisioning.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 All @@ -111,6 +111,6 @@ jobs:
DESIRED_COUNT="1"
fi
# Update the existing service
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.prod-taskdefinition.revision')
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.taskDefinition.revision')
aws ecs update-service --cluster ${CLUSTER} --region ap-southeast-1 --service ${SERVICE_NAME} --task-definition ${FAMILY}:${REVISION} --desired-count ${DESIRED_COUNT}
fi
12 changes: 6 additions & 6 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 All @@ -71,7 +71,7 @@ jobs:
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/agent-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/agent-service.json)
SERVICE_NAME="${NAME}-service"
SERVICE_NAME="agent-service"
echo "SERVICE_NAME: $SERVICE_NAME"
# Replace placeholders in the JSON file
Expand Down Expand Up @@ -99,6 +99,6 @@ jobs:
DESIRED_COUNT="1"
fi
# Update the existing service
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.prod-taskdefinition.revision')
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.taskDefinition.revision')
aws ecs update-service --cluster ${CLUSTER} --region ap-southeast-1 --service ${SERVICE_NAME} --task-definition ${FAMILY}:${REVISION} --desired-count ${DESIRED_COUNT}
fi
13 changes: 6 additions & 7 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 All @@ -72,7 +71,7 @@ jobs:
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/api-gateway-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/api-gateway-service.json)
SERVICE_NAME="${NAME}_service"
SERVICE_NAME="api_gateway-service"
echo "SERVICE_NAME: $SERVICE_NAME"
# Replace placeholders in the JSON file
Expand Down Expand Up @@ -100,6 +99,6 @@ jobs:
DESIRED_COUNT="1"
fi
# Update the existing service
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.prod-taskdefinition.revision')
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.taskDefinition.revision')
aws ecs update-service --cluster ${CLUSTER} --region ap-southeast-1 --service ${SERVICE_NAME} --task-definition ${FAMILY}:${REVISION} --desired-count ${DESIRED_COUNT}
fi
6 changes: 3 additions & 3 deletions .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 Expand Up @@ -71,7 +71,7 @@ jobs:
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/connection-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/connection-service.json)
SERVICE_NAME="${NAME}_service"
SERVICE_NAME="connection_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/connection-service.json > ${GITHUB_WORKSPACE}/${NAME}-v_${{ github.run_number }}.json
Expand All @@ -96,6 +96,6 @@ jobs:
DESIRED_COUNT="1"
fi
# Update the existing service
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.prod-taskdefinition.revision')
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.taskDefinition.revision')
aws ecs update-service --cluster ${CLUSTER} --region ap-southeast-1 --service ${SERVICE_NAME} --task-definition ${FAMILY}:${REVISION} --desired-count ${DESIRED_COUNT}
fi
6 changes: 3 additions & 3 deletions .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 Expand Up @@ -71,7 +71,7 @@ jobs:
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/ecosystem-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/ecosystem-service.json)
SERVICE_NAME="${NAME}_service"
SERVICE_NAME="ecosystem_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/ecosystem-service.json > ${GITHUB_WORKSPACE}/${NAME}-v_${{ github.run_number }}.json
Expand All @@ -96,6 +96,6 @@ jobs:
DESIRED_COUNT="1"
fi
# Update the existing service
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.prod-taskdefinition.revision')
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.taskDefinition.revision')
aws ecs update-service --cluster ${CLUSTER} --region ap-southeast-1 --service ${SERVICE_NAME} --task-definition ${FAMILY}:${REVISION} --desired-count ${DESIRED_COUNT}
fi
6 changes: 3 additions & 3 deletions .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 Expand Up @@ -71,7 +71,7 @@ jobs:
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/issuance-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/issuance-service.json)
SERVICE_NAME="${NAME}_service"
SERVICE_NAME="issuance_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/issuance-service.json > ${GITHUB_WORKSPACE}/${NAME}-v_${{ github.run_number }}.json
Expand All @@ -96,6 +96,6 @@ jobs:
DESIRED_COUNT="1"
fi
# Update the existing service
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.prod-taskdefinition.revision')
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.taskDefinition.revision')
aws ecs update-service --cluster ${CLUSTER} --region ap-southeast-1 --service ${SERVICE_NAME} --task-definition ${FAMILY}:${REVISION} --desired-count ${DESIRED_COUNT}
fi
6 changes: 3 additions & 3 deletions .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 Expand Up @@ -71,7 +71,7 @@ jobs:
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/ledger-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/ledger-service.json)
SERVICE_NAME="${NAME}_service"
SERVICE_NAME="ledger_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/ledger-service.json > ${GITHUB_WORKSPACE}/${NAME}-v_${{ github.run_number }}.json
Expand All @@ -96,6 +96,6 @@ jobs:
DESIRED_COUNT="1"
fi
# Update the existing service
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.prod-taskdefinition.revision')
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.taskDefinition.revision')
aws ecs update-service --cluster ${CLUSTER} --region ap-southeast-1 --service ${SERVICE_NAME} --task-definition ${FAMILY}:${REVISION} --desired-count ${DESIRED_COUNT}
fi
6 changes: 3 additions & 3 deletions .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 Expand Up @@ -71,7 +71,7 @@ jobs:
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/notification-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/notification-service.json)
SERVICE_NAME="${NAME}-service"
SERVICE_NAME="notification-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/notification-service.json > ${GITHUB_WORKSPACE}/${NAME}-v_${{ github.run_number }}.json
Expand All @@ -96,6 +96,6 @@ jobs:
DESIRED_COUNT="1"
fi
# Update the existing service
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.prod-taskdefinition.revision')
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.taskDefinition.revision')
aws ecs update-service --cluster ${CLUSTER} --region ap-southeast-1 --service ${SERVICE_NAME} --task-definition ${FAMILY}:${REVISION} --desired-count ${DESIRED_COUNT}
fi
6 changes: 3 additions & 3 deletions .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 Expand Up @@ -71,7 +71,7 @@ jobs:
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/organization-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/organization-service.json)
SERVICE_NAME="${NAME}_service"
SERVICE_NAME="organization_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/organization-service.json > ${GITHUB_WORKSPACE}/${NAME}-v_${{ github.run_number }}.json
Expand All @@ -96,6 +96,6 @@ jobs:
DESIRED_COUNT="1"
fi
# Update the existing service
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.prod-taskdefinition.revision')
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.taskDefinition.revision')
aws ecs update-service --cluster ${CLUSTER} --region ap-southeast-1 --service ${SERVICE_NAME} --task-definition ${FAMILY}:${REVISION} --desired-count ${DESIRED_COUNT}
fi
6 changes: 3 additions & 3 deletions .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 Expand Up @@ -71,7 +71,7 @@ jobs:
run: |
FAMILY=$(sed -n 's/.*"family": "\(.*\)",/\1/p' prod-taskdef/user-service.json)
NAME=$(sed -n 's/.*"name": "\(.*\)",/\1/p' prod-taskdef/user-service.json)
SERVICE_NAME="${NAME}-service"
SERVICE_NAME="user-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/user-service.json > ${GITHUB_WORKSPACE}/${NAME}-v_${{ github.run_number }}.json
Expand All @@ -96,6 +96,6 @@ jobs:
DESIRED_COUNT="1"
fi
# Update the existing service
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.prod-taskdefinition.revision')
REVISION=$(aws ecs describe-task-definition --task-definition ${FAMILY} --region ap-southeast-1 | jq -r '.taskDefinition.revision')
aws ecs update-service --cluster ${CLUSTER} --region ap-southeast-1 --service ${SERVICE_NAME} --task-definition ${FAMILY}:${REVISION} --desired-count ${DESIRED_COUNT}
fi
Loading

0 comments on commit e36cdf7

Please sign in to comment.