Browse Source

CLDC-2768: Sidekiq (AWS) (#1899)

* feat: update pipeline to deploy sidekiq to aws

* feat: update cron schedule to every 5mins temporarily

* feat: temporarily run aws_deploy on push to this branch

* feat: update aws ecs service name in pipeline

* Revert "feat: update cron schedule to every 5mins temporarily"

This reverts commit 80d0ab8383fa18e2bacd9ca0fa1a1d4048ef4f10.

* Revert "feat: temporarily run aws_deploy on push to this branch"

This reverts commit 48651712e6.

* style: remove unrequired empty line

* feat: reorder pipeline and update sidekiq task definition variable
pull/1882/head
Chirag-Bhatti 1 year ago committed by GitHub
parent
commit
48ec89e30f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      .github/workflows/aws_deploy.yml

30
.github/workflows/aws_deploy.yml

@ -117,7 +117,7 @@ jobs:
env:
ad_hoc_task_definition: ${{ inputs.aws_resource_prefix }}-ad-hoc
cluster: ${{ inputs.aws_resource_prefix }}
service: ${{ inputs.aws_resource_prefix }}
service: ${{ inputs.aws_resource_prefix }}-app
run: |
network=$(aws ecs describe-services --cluster $cluster --services $service --query services[0].networkConfiguration)
overrides='{ "containerOverrides" : [{ "name" : "app", "command" : ["bundle", "exec", "rake", "db:migrate"]}]}'
@ -129,13 +129,13 @@ jobs:
succeeded=$(aws ecs describe-tasks --cluster $cluster --tasks $id --query "tasks[0].stopCode == 'EssentialContainerExited' && to_string(tasks[0].containers[0].exitCode) == '0'")
if [ $succeeded == true ]; then exit 0; else exit 1; fi
- name: Download service task definition
- name: Download app service task definition
env:
app_task_definition: ${{ inputs.aws_resource_prefix }}-app
run: |
aws ecs describe-task-definition --task-definition $app_task_definition --query taskDefinition > app-task-definition.json
- name: Update image ID
- name: Update app image ID
id: app-task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
@ -147,6 +147,28 @@ jobs:
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
cluster: ${{ inputs.aws_resource_prefix }}
service: ${{ inputs.aws_resource_prefix }}
service: ${{ inputs.aws_resource_prefix }}-app
task-definition: ${{ steps.app-task-def.outputs.task-definition }}
wait-for-service-stability: true
- name: Download sidekiq service task definition
env:
sidekiq_task_definition: ${{ inputs.aws_resource_prefix }}-sidekiq
run: |
aws ecs describe-task-definition --task-definition $sidekiq_task_definition --query taskDefinition > sidekiq-task-definition.json
- name: Update sidekiq image ID
id: sidekiq-task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: sidekiq-task-definition.json
container-name: sidekiq
image: ${{ env.image }}
- name: Deploy updated sidekiq
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
cluster: ${{ inputs.aws_resource_prefix }}
service: ${{ inputs.aws_resource_prefix }}-sidekiq
task-definition: ${{ steps.sidekiq-task-def.outputs.task-definition }}
wait-for-service-stability: true

Loading…
Cancel
Save