Skip to content

Instantly share code, notes, and snippets.

@enokawa
Created December 11, 2019 18:39
Show Gist options
  • Save enokawa/1da5254e61f994061f76620a47336683 to your computer and use it in GitHub Desktop.
Save enokawa/1da5254e61f994061f76620a47336683 to your computer and use it in GitHub Desktop.
CircleCI Orbs Sample
version: 2.1
orbs:
aws-ecr: circleci/aws-ecr@6.2.0
aws-ecs: circleci/aws-ecs@0.0.3
workflows:
build_and_push_image:
jobs:
- aws-ecr/build-and-push-image:
name: nginx
context: dev
account-url: AWS_ECR_ACCOUNT_URL
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-secret-access-key: AWS_SECRET_ACCESS_KEY
dockerfile: docker/nginx/Dockerfile
region: AWS_REGION
repo: sample/nginx
tag: "${CIRCLE_SHA1}"
- aws-ecr/build-and-push-image:
name: php-fpm
context: dev
account-url: AWS_ECR_ACCOUNT_URL
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-secret-access-key: AWS_SECRET_ACCESS_KEY
dockerfile: docker/php-fpm/Dockerfile
region: AWS_REGION
repo: sample/php-fpm
tag: "${CIRCLE_SHA1}"
- aws-ecs/deploy-service-update:
requires:
- nginx
- php-fpm
context: dev
family: 'sample-app'
service-name: 'sample'
cluster-name: 'sample-cluster'
deployment-controller: 'CODE_DEPLOY'
codedeploy-application-name: 'AppECS-sample-cluster-sample'
codedeploy-deployment-group-name: 'DgpECS-sample-cluster-sample'
codedeploy-load-balanced-container-name: 'nginx'
codedeploy-load-balanced-container-port: 80
container-image-name-updates: 'container=nginx,image-and-tag=${AWS_ECR_ACCOUNT_URL}/sample/nginx:${CIRCLE_SHA1},container=php-fpm,image-and-tag=${AWS_ECR_ACCOUNT_URL}/sample/php-fpm:${CIRCLE_SHA1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment