Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit c6773c3

Browse files
committed
Run an actual provision on travis and do some sanity tests
1 parent 69c5025 commit c6773c3

File tree

1 file changed

+46
-11
lines changed

1 file changed

+46
-11
lines changed

.travis.yml

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,61 @@
22
language: python
33
python: "2.7"
44

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+
511
install:
612
# 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
816

917
# Add ansible.cfg to set local roles path.
1018
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
1119

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"
1622

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"
1927

2028
# 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)
2238
23-
# Check the config file and drupal make file YAML syntax.
2439
- >
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+
2659
- >
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

Comments
 (0)