-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
152 lines (120 loc) · 4.12 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
language: php
php:
- '5.5' # Ubuntu Trusty default
- '5.6' # MacOS default
- '7.0'
- '7.1'
sudo: required
services:
- docker
# Only run test when committing to master branch.
branches:
only:
- 7.x-3.x
- 4.x
env:
global:
# - AEGIR_HOSTING_VERSION=7.x-3.x
# - AEGIR_TESTS_VERSION=master
addons:
hosts:
- provision.local.computer
#services:
# - docker
before_install:
- docker run --name provision_db -e MYSQL_ROOT_PASSWORD=root -d -p 3307:3306 mariadb
# In order for provision to set files permissions properly the script user needs to be in the web user group.
# @TODO: Add this check to provision config.
- id
# We don't care which group the user is in, as long as it matches www-data inside the container.
# Provision uses these variables to build the container.
- 'echo "web_user: docker" >> ~/.provision.yml'
- 'echo "web_user_uid: 999" >> ~/.provision.yml'
- 'echo "config_path: /home/travis/config" >> ~/.provision.yml'
- 'echo "contexts_path: /home/travis/config/contexts" >> ~/.provision.yml'
install:
- composer install
- sudo ln -s $PWD/bin/provision /usr/local/bin/provision
- mkdir /home/travis/config/contexts -p
- ls -la
script:
# @TODO: Set non-interactive globally
- provision -n -v
- provision status -n
# Add server context.
- provision save --context=server_master -n
--context_type=server
--remote_host=provision.local.computer
--aegir_root=/var/aegir
--script_user=aegir
# Add services to server_master context.
- provision @server_master services add http -n
--service_type=apacheDocker
--http_port=80
--web_group=www-data
--restart_command="sudo apache2ctl graceful"
- provision @server_master services add db -n
--service_type=mysqlDocker
--master_db="mysql://root:root@db:3306"
--db_grant_all_hosts=1
- provision @server_master services
# Add platform context
- provision save --context=platform_hostmaster -n
--context_type=platform
--root=/home/travis/hostmaster
--server_http=server_master
--makefile=https://raw.githubusercontent.com/aegir-project/provision/7.x-3.x/provision-tests/makes/drupal7.make
--make_working_copy=1
# add http service to platform.
# @TODO: This should already be done thanks to --server_http!!!
- provision @platform_hostmaster services add http server_master
# Add site context
- provision save --context=hostmaster -n
--context_type=site
--platform=platform_hostmaster
--server_db=server_master
--uri=provision.local.computer
--language=en
--profile=hostmaster
--db_name=drupal
--db_user=drupal
--db_password=drupal
# Add a site context without a platform!
- provision save --context=eight.local.computer -n
--context_type=site
--server_db=server_master
--server_http=server_master
--uri=eight.local.computer
--language=en
--profile=atrium
--db_name=atrium
--db_user=atrium
--db_password=atrium
--root=/home/travis/eight
--makefile=https://raw.githubusercontent.com/aegir-project/provision/7.x-3.x/provision-tests/makes/drupal8.make
- provision status -n
- provision @server_master status
- provision @platform_hostmaster status
- provision @hostmaster status
- provision @eight.local.computer status
- provision @server_master verify
# Docker creates the host path when docker run happens, in server verify.
# Platform verify uses drush make, which won't run if folder exists.
# @TODO: Figure out how to deal with this within provision.
- sudo rm -rf /home/travis/hostmaster
- provision @platform_hostmaster verify
- ls -la /home/travis/hostmaster
- provision @hostmaster verify
- sudo rm -rf /home/travis/eight
- provision @eight.local.computer verify
- provision @server_master verify
- docker ps
- docker logs servermaster_http_1
# @TODO This fails right now.
# - docker exec servermaster_http_1 sudo apache2ctl -S
# Curling localhost is failing always. I'm commenting this out for now. This works!
#- sleep 5
- curl http://localhost | true
- curl http://provision.local.computer | true
- provision -n -v
- provision status -n