Skip to content

Commit 61106a9

Browse files
committed
Restore commented out steps in deployment actions
Signed-off-by: Kevin Ullyott <kevin.ullyott@canyongbs.com>
1 parent f300087 commit 61106a9

2 files changed

Lines changed: 266 additions & 266 deletions

File tree

.github/workflows/prerelease.yml

Lines changed: 133 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,21 @@ jobs:
8888
uses: aws-actions/amazon-ecs-deploy-task-definition@a310a830f5c14e583e35d84e4e1ec7dd177c3c9c #2.6.2
8989
with:
9090
task-definition: ${{ steps.task-def.outputs.task-definition }}
91-
# service: 'advisingapp-dev-service'
92-
# cluster: 'advisingapp-dev'
93-
# wait-for-service-stability: true
94-
95-
# - name: Check if deployment was successful
96-
# id: check-deployment
97-
# run: |
98-
# CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster advisingapp-dev --services advisingapp-dev-service --query services[0].deployments[0].taskDefinition | jq -r ".")
99-
# NEW_TASK_DEF_ARN=${{ steps.task-deploy.outputs.task-definition-arn }}
100-
# echo "Current task arn: $CURRENT_TASK_DEF_ARN"
101-
# echo "New task arn: $NEW_TASK_DEF_ARN"
102-
# if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then
103-
# echo "Deployment failed."
104-
# exit 1
105-
# fi
91+
service: 'advisingapp-dev-service'
92+
cluster: 'advisingapp-dev'
93+
wait-for-service-stability: true
94+
95+
- name: Check if deployment was successful
96+
id: check-deployment
97+
run: |
98+
CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster advisingapp-dev --services advisingapp-dev-service --query services[0].deployments[0].taskDefinition | jq -r ".")
99+
NEW_TASK_DEF_ARN=${{ steps.task-deploy.outputs.task-definition-arn }}
100+
echo "Current task arn: $CURRENT_TASK_DEF_ARN"
101+
echo "New task arn: $NEW_TASK_DEF_ARN"
102+
if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then
103+
echo "Deployment failed."
104+
exit 1
105+
fi
106106
107107
build-worker:
108108
name: Build Worker Image
@@ -184,21 +184,21 @@ jobs:
184184
uses: aws-actions/amazon-ecs-deploy-task-definition@a310a830f5c14e583e35d84e4e1ec7dd177c3c9c #2.6.2
185185
with:
186186
task-definition: ${{ steps.task-def.outputs.task-definition }}
187-
# service: 'advisingapp-worker-dev-service'
188-
# cluster: 'advisingapp-dev'
189-
# wait-for-service-stability: true
190-
191-
# - name: Check if deployment was successful
192-
# id: check-deployment
193-
# run: |
194-
# CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster advisingapp-dev --services advisingapp-worker-dev-service --query services[0].deployments[0].taskDefinition | jq -r ".")
195-
# NEW_TASK_DEF_ARN=${{ steps.task-deploy.outputs.task-definition-arn }}
196-
# echo "Current task arn: $CURRENT_TASK_DEF_ARN"
197-
# echo "New task arn: $NEW_TASK_DEF_ARN"
198-
# if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then
199-
# echo "Deployment failed."
200-
# exit 1
201-
# fi
187+
service: 'advisingapp-worker-dev-service'
188+
cluster: 'advisingapp-dev'
189+
wait-for-service-stability: true
190+
191+
- name: Check if deployment was successful
192+
id: check-deployment
193+
run: |
194+
CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster advisingapp-dev --services advisingapp-worker-dev-service --query services[0].deployments[0].taskDefinition | jq -r ".")
195+
NEW_TASK_DEF_ARN=${{ steps.task-deploy.outputs.task-definition-arn }}
196+
echo "Current task arn: $CURRENT_TASK_DEF_ARN"
197+
echo "New task arn: $NEW_TASK_DEF_ARN"
198+
if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then
199+
echo "Deployment failed."
200+
exit 1
201+
fi
202202
203203
build-scheduler:
204204
name: Build Scheduler Image
@@ -280,106 +280,106 @@ jobs:
280280
uses: aws-actions/amazon-ecs-deploy-task-definition@a310a830f5c14e583e35d84e4e1ec7dd177c3c9c #2.6.2
281281
with:
282282
task-definition: ${{ steps.task-def.outputs.task-definition }}
283-
# service: 'advisingapp-scheduler-dev-service'
284-
# cluster: 'advisingapp-dev'
285-
# wait-for-service-stability: true
286-
287-
# - name: Check if deployment was successful
288-
# id: check-deployment
289-
# run: |
290-
# CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster advisingapp-dev --services advisingapp-scheduler-dev-service --query services[0].deployments[0].taskDefinition | jq -r ".")
291-
# NEW_TASK_DEF_ARN=${{ steps.task-deploy.outputs.task-definition-arn }}
292-
# echo "Current task arn: $CURRENT_TASK_DEF_ARN"
293-
# echo "New task arn: $NEW_TASK_DEF_ARN"
294-
# if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then
295-
# echo "Deployment failed."
296-
# exit 1
297-
# fi
298-
299-
# build-release-automation:
300-
# name: Build Release Automation Image
301-
# runs-on: ubuntu-22.04
302-
# outputs:
303-
# image: ${{ steps.build-image.outputs.image }}
304-
# environment: staging
305-
306-
# steps:
307-
# - name: Checkout
308-
# uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #6.0.2
309-
# with:
310-
# submodules: true
311-
# ref: ${{ github.head_ref }}
312-
# token: ${{ secrets.PAT }}
313-
314-
# - name: Login to Docker Hub
315-
# uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 #4.1.0
316-
# with:
317-
# username: ${{ secrets.DOCKERHUB_USERNAME }}
318-
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
319-
320-
# - name: Configure AWS credentials
321-
# uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 #6.1.0
322-
# with:
323-
# aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
324-
# aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
325-
# aws-region: ${{ env.AWS_REGION }}
326-
327-
# - name: Login to Amazon ECR
328-
# id: login-ecr
329-
# uses: aws-actions/amazon-ecr-login@19d944daaa35f0fa1d3f7f8af1d3f2e5de25c5b7 #2.1.4
330-
331-
# - name: Build, tag, and push image to Amazon ECR
332-
# id: build-image
333-
# env:
334-
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
335-
# IMAGE_TAG: ${{ github.event.release.tag_name }}
336-
# ECR_REPOSITORY: 'advisingapp/release-automation'
337-
# run: |
338-
# # Build a docker container and
339-
# # push it to ECR so that it can
340-
# # be deployed to ECS.
341-
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG --target release-automation --platform linux/amd64 .
342-
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
343-
# echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
344-
345-
# deploy-release-automation:
346-
# name: Deploy and Run Release Automation Service
347-
# needs: [deploy-web, deploy-worker, deploy-scheduler, build-release-automation]
348-
# runs-on: ubuntu-22.04
349-
# environment: staging
350-
351-
# steps:
352-
# - name: Checkout
353-
# uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #6.0.2
354-
# with:
355-
# submodules: true
356-
# ref: ${{ github.head_ref }}
357-
# token: ${{ secrets.PAT }}
358-
359-
# - name: Configure AWS credentials
360-
# uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 #6.1.0
361-
# with:
362-
# aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
363-
# aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
364-
# aws-region: ${{ env.AWS_REGION }}
365-
366-
# - name: Fill in the new image ID in the Amazon ECS task definition
367-
# id: task-def
368-
# uses: aws-actions/amazon-ecs-render-task-definition@6853cfae8c3a7d978fbf68b5a55453395541dfbb #1.8.5
369-
# with:
370-
# task-definition: 'docker/devops/ecs/advisingapp/advisingapp-release-automation-dev-task-definition.json'
371-
# container-name: 'release-automation'
372-
# image: ${{ needs.build-release-automation.outputs.image }}
373-
374-
# - name: Deploy Amazon ECS task definition
375-
# uses: aws-actions/amazon-ecs-deploy-task-definition@a310a830f5c14e583e35d84e4e1ec7dd177c3c9c #2.6.2
376-
# with:
377-
# task-definition: ${{ steps.task-def.outputs.task-definition }}
378-
# cluster: 'advisingapp-dev'
379-
# desired-count: 1
380-
# run-task: true
381-
# run-task-security-groups: ${{ secrets.RELEASE_AUTOMATION_SECURITY_GROUPS }}
382-
# run-task-subnets: ${{ secrets.RELEASE_AUTOMATION_SUBNETS }}
383-
# run-task-assign-public-IP: 'DISABLED'
384-
# run-task-launch-type: 'FARGATE'
385-
# wait-for-task-stopped: true
283+
service: 'advisingapp-scheduler-dev-service'
284+
cluster: 'advisingapp-dev'
285+
wait-for-service-stability: true
286+
287+
- name: Check if deployment was successful
288+
id: check-deployment
289+
run: |
290+
CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster advisingapp-dev --services advisingapp-scheduler-dev-service --query services[0].deployments[0].taskDefinition | jq -r ".")
291+
NEW_TASK_DEF_ARN=${{ steps.task-deploy.outputs.task-definition-arn }}
292+
echo "Current task arn: $CURRENT_TASK_DEF_ARN"
293+
echo "New task arn: $NEW_TASK_DEF_ARN"
294+
if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then
295+
echo "Deployment failed."
296+
exit 1
297+
fi
298+
299+
build-release-automation:
300+
name: Build Release Automation Image
301+
runs-on: ubuntu-22.04
302+
outputs:
303+
image: ${{ steps.build-image.outputs.image }}
304+
environment: staging
305+
306+
steps:
307+
- name: Checkout
308+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #6.0.2
309+
with:
310+
submodules: true
311+
ref: ${{ github.head_ref }}
312+
token: ${{ secrets.PAT }}
313+
314+
- name: Login to Docker Hub
315+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 #4.1.0
316+
with:
317+
username: ${{ secrets.DOCKERHUB_USERNAME }}
318+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
319+
320+
- name: Configure AWS credentials
321+
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 #6.1.0
322+
with:
323+
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
324+
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
325+
aws-region: ${{ env.AWS_REGION }}
326+
327+
- name: Login to Amazon ECR
328+
id: login-ecr
329+
uses: aws-actions/amazon-ecr-login@19d944daaa35f0fa1d3f7f8af1d3f2e5de25c5b7 #2.1.4
330+
331+
- name: Build, tag, and push image to Amazon ECR
332+
id: build-image
333+
env:
334+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
335+
IMAGE_TAG: ${{ github.event.release.tag_name }}
336+
ECR_REPOSITORY: 'advisingapp/release-automation'
337+
run: |
338+
# Build a docker container and
339+
# push it to ECR so that it can
340+
# be deployed to ECS.
341+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG --target release-automation --platform linux/amd64 .
342+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
343+
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
344+
345+
deploy-release-automation:
346+
name: Deploy and Run Release Automation Service
347+
needs: [deploy-web, deploy-worker, deploy-scheduler, build-release-automation]
348+
runs-on: ubuntu-22.04
349+
environment: staging
350+
351+
steps:
352+
- name: Checkout
353+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #6.0.2
354+
with:
355+
submodules: true
356+
ref: ${{ github.head_ref }}
357+
token: ${{ secrets.PAT }}
358+
359+
- name: Configure AWS credentials
360+
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 #6.1.0
361+
with:
362+
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
363+
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
364+
aws-region: ${{ env.AWS_REGION }}
365+
366+
- name: Fill in the new image ID in the Amazon ECS task definition
367+
id: task-def
368+
uses: aws-actions/amazon-ecs-render-task-definition@6853cfae8c3a7d978fbf68b5a55453395541dfbb #1.8.5
369+
with:
370+
task-definition: 'docker/devops/ecs/advisingapp/advisingapp-release-automation-dev-task-definition.json'
371+
container-name: 'release-automation'
372+
image: ${{ needs.build-release-automation.outputs.image }}
373+
374+
- name: Deploy Amazon ECS task definition
375+
uses: aws-actions/amazon-ecs-deploy-task-definition@a310a830f5c14e583e35d84e4e1ec7dd177c3c9c #2.6.2
376+
with:
377+
task-definition: ${{ steps.task-def.outputs.task-definition }}
378+
cluster: 'advisingapp-dev'
379+
desired-count: 1
380+
run-task: true
381+
run-task-security-groups: ${{ secrets.RELEASE_AUTOMATION_SECURITY_GROUPS }}
382+
run-task-subnets: ${{ secrets.RELEASE_AUTOMATION_SUBNETS }}
383+
run-task-assign-public-IP: 'DISABLED'
384+
run-task-launch-type: 'FARGATE'
385+
wait-for-task-stopped: true

0 commit comments

Comments
 (0)