I am new to CircleCI and I need help for config.yml through which i planned to deploy my prebuilt docker images stored in ECR repository to a particular EC2 machine through docker-compose yml.
Kindly point out some example to achieve this task.
Thanks in advance!
this is how I am doing it
version: 2.1 # CircleCI version
orbs:
aws-s3: circleci/aws-s3@2.0.0
jobs:
build:
machine: true # Use a Linux VM instead of docker environment
working_directory: ~/repo # Default working directory, where your project will be cloned
steps:
- checkout
- run: bin/start
- aws-s3/copy:
#some aws commands here
- run: |
docker ps -a
docker-compose up -d
deploy:
machine: true # Use a Linux VM instead of docker environment
working_directory: ~/repo # Default working directory, where your project will be cloned
steps:
- checkout
- add_ssh_keys:
fingerprints:
- "my:finger:print"
- run:
name: "Deploy run:"
command: ssh -v -o StrictHostKeyChecking=no example@0.0.0.0 "cd /var/www/html && do magic"
workflows:
version: 2.1
build_and_test:
jobs:
- build
- deploy:
requires:
- build