From 1eeb3706478bca6074ba3fd8dd67487bfaebc86f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 7 Feb 2020 08:00:00 +0000 Subject: [PATCH] Add Circle CI config --- .circleci/config.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..33f18e5 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,35 @@ +version: 2 + +jobs: + deploy: + working_directory: ~/oliverdavies-uk + docker: + - image: ansible/ansible:ubuntu1604 + environment: + ANSIBLE_HOST_KEY_CHECKING: no + steps: + # Installation + - run: + name: Install System Packages + command: pip install --upgrade pip && pip install ansible + + # Dependencies + - checkout + - restore_cache: + key: oliverdavies-uk-{{ .Branch }}-{{ checksum "./tools/ansible/requirements.yml" }}-v1 + - run: ansible-galaxy install -r tools/ansible/requirements.yml + - save_cache: + key: oliverdavies-uk-{{ .Branch }}-{{ checksum "./tools/ansible/requirements.yml" }}-v1 + paths: + - '/root/.ansible/roles' + + # Deploy + - run: echo $ANSIBLE_VAULT_PASS > ./tools/ansible/.vault-pass.txt + - run: ansible-playbook tools/ansible/deploy.yml --vault-password-file=./tools/ansible/.vault-pass.txt + - run: rm ./tools/ansible/.vault-pass.txt + +workflows: + version: 2 + build_test_and_deploy: + jobs: + - deploy