forked from opendevshop/devshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
77 lines (66 loc) · 2.71 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
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: /usr/lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
script_opts: "--server-webserver=apache"
- test: CentOS 7 NGINX
distribution: centos
version: 7
init: /usr/lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
script_opts: "--server-webserver=nginx"
- test: Ubuntu 14.04 Apache
distribution: ubuntu
version: 14.04
init: /sbin/init
run_opts: ""
script_opts: "--server-webserver=apache"
- test: Ubuntu 14.04 Nginx
distribution: ubuntu
version: 14.04
init: /sbin/init
run_opts: ""
script_opts: "--server-webserver=nginx"
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}":/usr/share/devshop:rw ${run_opts} -h devshop.travis --add-host "dev.projectname.devshop.travis live.projectname.devshop.travis":127.0.0.1 ${distribution}-${version}:ansible "${init}" > "${container_id}"'
# Ansible syntax check.
- 'sudo docker exec --tty devshop_container env TERM=xterm ansible-playbook /usr/share/devshop/playbook.yml --syntax-check'
# Install script.
- 'sudo docker exec --tty devshop_container env TRAVIS=true TERM=xterm /usr/share/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 hosting queued, and the hosting task queue.
- '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 /usr/share/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'