Add Circle CI config
This commit is contained in:
parent
f6e10d4c49
commit
1eeb370647
35
.circleci/config.yml
Normal file
35
.circleci/config.yml
Normal file
|
@ -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
|
Loading…
Reference in a new issue