-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwercker.yml
48 lines (46 loc) · 1.75 KB
/
wercker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
box: williamyeh/ansible:ubuntu16.04
services:
- id: postgres
env:
POSTGRES_PASSWORD: airflowsecret
POSTGRES_USER: airflow
# Build definition
build:
# The steps that will be executed on build
steps:
- script:
name: Update apt repository
sudo: yes
code: |
apt-get update
- install-packages:
packages: git sudo python-pip libffi-dev libssh-dev postgresql-client
- script:
name: Install Python requirements
sudo: yes
code: |
pip install --upgrade pip
pip install -r tests/requirements.txt
- script:
name: Add this project as a role and marathon-app
sudo: yes
code: |
mkdir -p .molecule/roles
cd .molecule/roles/
ln -s -r ../.. ansible-airflow
git clone https://github.com/ludovicc/ansible-marathon_app.git marathon-app
- script:
name: Test installation of Airflow with this role
sudo: yes
code: |
# Run the role/playbook with ansible-playbook.
ansible-playbook -i tests/inventory -e airflow_sql_alchemy_conn='postgresql://airflow:airflowsecret@postgres/airflow' tests/playbook.yml --connection=local --sudo -vvvv
- script:
name: Test idempotence for this role
sudo: yes
code: |
# Run the role/playbook again, checking to make sure it's idempotent.
ansible-playbook -i tests/inventory -e airflow_sql_alchemy_conn='postgresql://airflow:airflowsecret@postgres/airflow' tests/playbook.yml --connection=local --sudo \
| tee run-again.log
cat run-again.log | grep -q 'changed=0.*failed=0' \
&& (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)