19
19
distro : ubuntu1604
20
20
init : /sbin/init
21
21
run_opts : " --privileged"
22
- # Defaults - Ubuntu 14.04.
23
- - type : defaults
24
- distro : ubuntu1404
25
- init : /sbin/init
26
- run_opts : " --privileged"
27
- # PHP 5.6 - Ubuntu 16.04.
28
- - type : defaults
29
- distro : ubuntu1604
30
- init : /sbin/init
31
- run_opts : " --privileged"
32
- local_config : tests/ubuntu-16-php56.config.yml
33
- DRUSH_BIN : " ${DRUPALVM_DIR}/drupal/vendor/drush/drush/drush"
34
- TEST_INSTALLED_EXTRAS : false
35
- # Nginx and Drush make file test - Ubuntu 16.04.
36
- - type : nginx-drush-make
37
- distro : ubuntu1604
38
- init : /sbin/init
39
- run_opts : " --privileged"
40
- local_config : tests/ubuntu-16-nginx.config.yml
41
- config_dir : /var/www/drupalvm/config
42
- # PostgreSQL - Ubuntu 16.04.
43
- - type : postgresql
44
- distro : ubuntu1604
45
- init : /sbin/init
46
- run_opts : " --privileged"
47
- local_config : tests/ubuntu-16-postgresql.config.yml
48
- config_dir : /var/www/drupalvm/config
49
- DRUSH_BIN : " ${DRUPALVM_DIR}/drupal/vendor/drush/drush/drush"
50
- TEST_INSTALLED_EXTRAS : false
51
- # Defaults - CentOS 7.
52
- - type : centos
53
- distro : centos7
54
- init : /usr/lib/systemd/systemd
55
- run_opts : " --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
56
- # Defaults - Debian 8.
57
- - type : debian
58
- distro : debian8
59
- init : /lib/systemd/systemd
60
- run_opts : " --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
22
+ # # Defaults - Ubuntu 14.04.
23
+ # - type: defaults
24
+ # distro: ubuntu1404
25
+ # init: /sbin/init
26
+ # run_opts: "--privileged"
27
+ # # PHP 5.6 - Ubuntu 16.04.
28
+ # - type: defaults
29
+ # distro: ubuntu1604
30
+ # init: /sbin/init
31
+ # run_opts: "--privileged"
32
+ # local_config: tests/ubuntu-16-php56.config.yml
33
+ # DRUSH_BIN: "${DRUPALVM_DIR}/drupal/vendor/drush/drush/drush"
34
+ # TEST_INSTALLED_EXTRAS: false
35
+ # # Nginx and Drush make file test - Ubuntu 16.04.
36
+ # - type: nginx-drush-make
37
+ # distro: ubuntu1604
38
+ # init: /sbin/init
39
+ # run_opts: "--privileged"
40
+ # local_config: tests/ubuntu-16-nginx.config.yml
41
+ # config_dir: /var/www/drupalvm/config
42
+ # # PostgreSQL - Ubuntu 16.04.
43
+ # - type: postgresql
44
+ # distro: ubuntu1604
45
+ # init: /sbin/init
46
+ # run_opts: "--privileged"
47
+ # local_config: tests/ubuntu-16-postgresql.config.yml
48
+ # config_dir: /var/www/drupalvm/config
49
+ # DRUSH_BIN: "${DRUPALVM_DIR}/drupal/vendor/drush/drush/drush"
50
+ # TEST_INSTALLED_EXTRAS: false
51
+ # # Defaults - CentOS 7.
52
+ # - type: centos
53
+ # distro: centos7
54
+ # init: /usr/lib/systemd/systemd
55
+ # run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
56
+ # # Defaults - Debian 8.
57
+ # - type: debian
58
+ # distro: debian8
59
+ # init: /lib/systemd/systemd
60
+ # run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
61
61
62
62
before_install :
63
63
# Pull container.
@@ -67,91 +67,9 @@ before_install:
67
67
- ' gem install rubocop'
68
68
69
69
script :
70
- # Run container in detached state and store the id.
71
- - ' tmpfile=$(mktemp)'
72
- - ' docker run --detach --add-host "${HOSTNAME}$(echo -e "\t")${MACHINE_NAME}":127.0.0.1 --volume="${PWD}":${DRUPALVM_DIR}/:rw ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${tmpfile}"'
73
- - ' container_id=$(cat ${tmpfile})'
74
-
75
- # Setup directories.
76
- - ' docker exec ${container_id} mkdir -p ${DRUPALVM_DIR}/drupal'
77
-
78
- # Setup config directory.
79
- - ' [[ ! -z "${config_dir}" ]] && docker exec ${container_id} mkdir -p ${config_dir} || true'
80
-
81
- # Copy configuration files into place.
82
- - ' docker exec ${container_id} cp ${DRUPALVM_DIR}/${CONFIG} ${config_dir:-$DRUPALVM_DIR}/config.yml'
83
- - ' docker exec ${container_id} cp ${DRUPALVM_DIR}/${MAKEFILE} ${config_dir:-$DRUPALVM_DIR}/drupal.make.yml'
84
- - ' docker exec ${container_id} cp ${DRUPALVM_DIR}/${COMPOSERFILE} ${config_dir:-$DRUPALVM_DIR}/drupal.composer.json'
85
-
86
- - ' [[ ! -z "${DRUPALVM_ENV}" ]] && docker exec ${container_id} bash -c "cp ${DRUPALVM_DIR}/tests/${DRUPALVM_ENV}.config.yml ${config_dir:-$DRUPALVM_DIR}/${DRUPALVM_ENV}.config.yml" || true'
87
-
88
- # Override configuration variables.
89
- - ' [[ ! -z "${local_config}" ]] && docker exec ${container_id} bash -c "cp ${DRUPALVM_DIR}/${local_config} ${config_dir:-$DRUPALVM_DIR}/local.config.yml" || true'
90
-
91
70
# Vagrantfile syntax check.
92
71
- ' rubocop ./Vagrantfile ./lib/drupalvm --except LineLength,Eval,MutableConstant,BlockLength,ConditionalAssignment,IndentArray,AlignParameters'
93
72
94
- # Ansible syntax check.
95
- - ' docker exec --tty ${container_id} env TERM=xterm ansible-playbook ${DRUPALVM_DIR}/provisioning/playbook.yml --syntax-check'
96
-
97
- # Run the test setup playbook with ansible-playbook.
98
- - ' docker exec --tty ${container_id} env TERM=xterm ansible-playbook ${DRUPALVM_DIR}/tests/test-setup.yml'
99
-
100
- # Run the playbook with ansible-playbook.
101
- - >
102
- if [ ! -z "${config_dir}" ]; then
103
- docker exec ${container_id} env TERM=xterm DRUPALVM_ENV=${DRUPALVM_ENV} ansible-playbook ${DRUPALVM_DIR}/provisioning/playbook.yml --extra-vars="config_dir=${config_dir}";
104
- else
105
- docker exec ${container_id} env TERM=xterm DRUPALVM_ENV=${DRUPALVM_ENV} ansible-playbook ${DRUPALVM_DIR}/provisioning/playbook.yml;
106
- fi
107
-
108
- # Run integration tests.
109
- - >
110
- docker exec ${container_id} curl -s --header Host:${HOSTNAME} localhost
111
- | grep -q '<title>Welcome to Drupal'
112
- && (echo 'Drupal install pass' && exit 0)
113
- || (echo 'Drupal install fail' && exit 1)
114
-
115
- - >
116
- if [ $TEST_INSTALLED_EXTRAS = true ]; then
117
- docker exec ${container_id} curl -s --header Host:adminer.${HOSTNAME} localhost \
118
- | grep -q '<title>Login - Adminer' \
119
- && (echo 'Adminer install pass' && exit 0) \
120
- || (echo 'Adminer install fail' && exit 1)
121
- fi
122
-
123
- - >
124
- if [ $TEST_INSTALLED_EXTRAS = true ]; then
125
- docker exec ${container_id} curl -s --header Host:pimpmylog.${HOSTNAME} localhost \
126
- | grep -q '<title>Pimp my Log' \
127
- && (echo 'Pimp my Log install pass' && exit 0) \
128
- || (echo 'Pimp my Log install fail' && exit 1)
129
- fi
130
-
131
- - >
132
- if [ $TEST_INSTALLED_EXTRAS = true ]; then
133
- docker exec ${container_id} curl -s localhost:8025 \
134
- | grep -q '<title>MailHog' \
135
- && (echo 'MailHog install pass' && exit 0) \
136
- || (echo 'MailHog install fail' && exit 1)
137
- fi
138
-
139
- - >
140
- if [ $TEST_INSTALLED_EXTRAS = true ]; then
141
- docker exec ${container_id} curl -sI --header Host:${HOSTNAME} localhost:81 \
142
- | grep -q 'Via: .* varnish' \
143
- && (echo 'Varnish install pass' && exit 0) \
144
- || (echo 'Varnish install fail' && exit 1)
145
- fi
146
-
147
- - >
148
- docker exec ${container_id} curl -s --header Host:${IP} localhost
149
- | grep -q "<li>${IP} ${HOSTNAME}</li>"
150
- && (echo 'Dashboard install pass' && exit 0)
151
- || (echo 'Dashboard install fail' && exit 1)
73
+ # Try something quite radical.
74
+ - composer run-tests
152
75
153
- - >
154
- docker exec ${container_id} ${DRUSH_BIN} @${MACHINE_NAME}.${HOSTNAME} status
155
- | grep -q 'Drupal bootstrap.*Successful'
156
- && (echo 'Drush install pass' && exit 0)
157
- || (echo 'Drush install fail' && exit 1)
0 commit comments