forked from addshore/mediawiki-docker-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathup
executable file
·49 lines (39 loc) · 1.23 KB
/
up
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
#!/bin/sh
cd $(dirname $0)
#if hash php 2>/dev/null; then
# php ./scripts/checkHosts.php
# [ $? -ne 0 ] && exit
#else
# echo "PHP not installed so hosts file not checked."
# echo "You may want to manually check the ./config/local/hosts file and add these to your local hosts file."
#fi
echo "You will need to check the ./config/local/hosts file and add these to your local hosts file."
# Create a combined .env file
touch ./.env
rm ./.env
cat ./default.env >> .env
sed -i -e '$a\' .env
touch ./local.env
cat ./local.env >> .env
sed -i -e '$a\' .env
# Switch -dev for php vs hhvm (as there is no -dev) for hhvm
if grep -q PHPORHHVM=hhvm .env; then
echo "DOCKERPHPDEV=" >> .env
else
echo "DOCKERPHPDEV=-dev" >> .env
fi
# Start Containers
echo "Containers are starting"
docker-compose up -d
# Update composer
echo "Running composer install on the web container"
docker-compose exec "web" composer install --working-dir //var/www/mediawiki
echo "Waiting for the db server to finish starting"
docker-compose exec "web" //srv/wait-for-it.sh db:3306
echo "Adding services to hosts file"
./addhost phpmyadmin.mw.local
./addhost graphite.mw.local
# Add the default site
./addsite default
# Done
echo "Your development environment is running"