diff --git a/.circleci/config.yml b/.circleci/config.yml index 8426b3a..f99fcd5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -162,25 +162,28 @@ jobs: paths: - project/.circleci/ansible/inventory.txt - destroy-environment -# configure-infrastructure: -# docker: -# # Docker image here that supports Ansible -# steps: -# # Checkout code from git -# # Add ssh keys with fingerprint -# # attach workspace -# - run: -# name: Install dependencies -# command: | -# # Your code here -# exit 1 -# - run: -# name: Configure server -# command: | -# # Your code here -# exit 1 -# # Here's where you will add some code to rollback on failure - + configure-infrastructure: + docker: + - image: ubuntu-2004:2023.10.1 + steps: + - checkout + - add_ssh_keys: + fingerprints: [ad:8d:62:dc:0b:b1:23:7d:90:1f:17:39:51:2c:29:8f] + - persist_to_workspace: + root: ~/ + paths: ~/ + - run: + name: Install dependencies + command: | + sudo apt-add-repository ppa:ansible/ansible + sudo apt update + sudo apt install ansible + - run: + name: Configure server + command: | + cd .circleci/ansible + ansible-playbook -i inventory.txt configure-server.yml + - destroy-environment # run-migrations: # docker: # # Docker image here that supports NodeJS @@ -312,8 +315,8 @@ workflows: filters: branches: only: [test-feature-branch] - # - configure-infrastructure: - # requires: [deploy-infrastructure] + - configure-infrastructure: + requires: [deploy-infrastructure] # - run-migrations: # requires: [configure-infrastructure] # - deploy-frontend: