forked from opendevshop/devshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
82 lines (71 loc) · 2.75 KB
/
.travis.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
sudo: required
env:
# CentOS 6: Not supported yet.
#- distribution: centos
# version: 6
# init: /sbin/init
# run_opts: ""
# Ubuntu 12.04: Not supported yet.
#- distribution: ubuntu
# version: 12.04
# init: /sbin/init
# run_opts: ""
- test: CentOS 7 Apache
distribution: centos
version: 7
init: /sbin/init
run_opts: ""
script_opts: "--server-webserver=apache"
supervisor_stop: "systemctl stop supervisord"
- test: CentOS 7 NGINX
distribution: centos
version: 7
init: /sbin/init
run_opts: ""
script_opts: "--server-webserver=nginx"
supervisor_stop: "systemctl stop supervisord"
- test: Ubuntu 14.04 Apache
distribution: ubuntu
version: 14.04
init: /sbin/init
run_opts: ""
script_opts: "--server-webserver=apache"
supervisor_stop: "service supervisor stop"
- test: Ubuntu 14.04 Nginx
distribution: ubuntu
version: 14.04
init: /sbin/init
run_opts: ""
script_opts: "--server-webserver=nginx"
supervisor_stop: "service supervisor stop"
addons:
hosts:
- devshop.travis
- dev.projectname.devshop.travis
- live.projectname.devshop.travis
services:
- docker
before_install:
# Pull container
- 'sudo docker pull ${distribution}:${version}'
# Customize container
- 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests'
script:
- container_id=$(mktemp)
# Run container in detached state
- 'sudo docker run --detach --name devshop_container --volume="${PWD}":/etc/ansible/devshop:rw ${run_opts} -h devshop.travis ${distribution}-${version}:ansible "${init}" > "${container_id}"'
# Ansible syntax check.
- 'sudo docker exec --tty devshop_container env TERM=xterm ansible-playbook /etc/ansible/devshop/playbook.yml --syntax-check'
# Install script.
- 'sudo docker exec --tty devshop_container env TERM=xterm /etc/ansible/devshop/install.sh ${script_opts} --hostname=devshop.travis'
# Hostmaster Status
- 'sudo docker exec devshop_container env TERM=xterm sudo su - aegir -c "drush @hostmaster status"'
# Turn off supervisor, hosting queued, and the hosting task queue.
- 'sudo docker exec devshop_container ${supervisor_stop}'
- 'sudo docker exec devshop_container env sudo su - aegir -c "drush @hostmaster dis hosting_queued -y -v"'
- 'sudo docker exec devshop_container env sudo su - aegir -c "drush @hostmaster vset hosting_queue_tasks_enabled 0 -y"'
# Build and Run Tests
- 'sudo docker exec devshop_container env TERM=xterm sudo su - -c "cd /etc/ansible/devshop/tests && composer update"'
- 'sudo docker exec devshop_container env TERM=xterm sudo su - aegir -c "devshop devmaster:test"'
# Stop container.
- 'sudo docker stop devshop_container'