|
2 | 2 | language: python |
3 | 3 | python: "2.7" |
4 | 4 |
|
| 5 | +env: |
| 6 | + - CONFIG=example.config.yml MAKEFILE=example.drupal.make.yml HOSTNAME=drupalvm.dev MACHINE_NAME=drupalvm |
| 7 | + |
| 8 | +before_install: |
| 9 | + - sudo apt-get update -qq |
| 10 | + |
5 | 11 | install: |
6 | 12 | # Install Ansible. |
7 | | - - pip install ansible |
| 13 | + # TODO - remove specific version number after the following issue is fixed: |
| 14 | + # https://github.com/ansible/ansible-modules-core/issues/2473 |
| 15 | + - pip install ansible==1.9.4 |
8 | 16 |
|
9 | 17 | # Add ansible.cfg to set local roles path. |
10 | 18 | - "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg" |
11 | 19 |
|
12 | | -script: |
13 | | - # Copy example files into place. |
14 | | - - cp example.config.yml config.yml |
15 | | - - cp example.drupal.make.yml drupal.make.yml |
| 20 | + # Install dependencies. |
| 21 | + - "ansible-galaxy install -r provisioning/requirements.yml" |
16 | 22 |
|
17 | | - # Make sure Ansible requirements install correctly. |
18 | | - - 'ansible-galaxy install -r provisioning/requirements.yml' |
| 23 | +script: |
| 24 | + # Copy configuration files into place. |
| 25 | + - "cp $CONFIG config.yml" |
| 26 | + - "cp $MAKEFILE drupal.make.yml" |
19 | 27 |
|
20 | 28 | # Run Ansible's syntax and playbook check on the main playbook. |
21 | | - - 'ansible-playbook -i "localhost," -c local provisioning/playbook.yml --syntax-check' |
| 29 | + - "ansible-playbook -i 'localhost,' provisioning/playbook.yml --connection=local --syntax-check" |
| 30 | + |
| 31 | + # Run the role/playbook with ansible-playbook. |
| 32 | + - "ansible-playbook -i 'localhost,' provisioning/playbook.yml --connection=local --sudo" |
| 33 | + |
| 34 | + - > |
| 35 | + curl -s --header "Host: $HOSTNAME" localhost | grep -q '<title>Welcome to Drupal' |
| 36 | + && (echo 'Drupal install test: pass' && exit 0) |
| 37 | + || (echo 'Drupal install test: fail' && exit 1) |
22 | 38 |
|
23 | | - # Check the config file and drupal make file YAML syntax. |
24 | 39 | - > |
25 | | - python -c "import yaml; yaml.load( open('example.config.yml', 'r'), Loader=yaml.CLoader )" |
| 40 | + curl -s --header "Host: adminer.$HOSTNAME" localhost | grep -q '<title>Login - Adminer' |
| 41 | + && (echo 'Adminer install test: pass' && exit 0) |
| 42 | + || (echo 'Adminer install test: fail' && exit 1) |
| 43 | +
|
| 44 | + - > |
| 45 | + curl -s --header "Host: pimpmylog.$HOSTNAME" localhost | grep -q '<title>Pimp my Log' |
| 46 | + && (echo 'Pimp my Log install test: pass' && exit 0) |
| 47 | + || (echo 'Pimp my Log install test: fail' && exit 1) |
| 48 | +
|
| 49 | + - > |
| 50 | + curl -s --header "Host: xhprof.$HOSTNAME" localhost | grep -q '<title>XHProf' |
| 51 | + && (echo 'Adminer install test: pass' && exit 0) |
| 52 | + || (echo 'Adminer install test: fail' && exit 1) |
| 53 | +
|
| 54 | + - > |
| 55 | + curl -s localhost:8025 | grep -q '<title>MailHog' |
| 56 | + && (echo 'Adminer install test: pass' && exit 0) |
| 57 | + || (echo 'Adminer install test: fail' && exit 1) |
| 58 | +
|
26 | 59 | - > |
27 | | - python -c "import yaml; yaml.load( open('example.drupal.make.yml', 'r'), Loader=yaml.CLoader )" |
| 60 | + drush "@$MACHINE_NAME.$HOSTNAME" status | grep -q 'Drupal bootstrap.*Successful' |
| 61 | + && (echo 'Drush install test: pass' && exit 0) |
| 62 | + || (echo 'Drush install test: fail' && exit 1) |
0 commit comments