-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·35 lines (27 loc) · 1.27 KB
/
install.sh
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
#!/usr/bin/env bash
echo "###### Destroying all old containers ######"
docker-compose down
echo "###### Building Drupal Docker Image. This may take some time. ######"
docker build --quiet -t fpe/drupal docker-drupal
echo "###### Creating containers for database and web server ######"
docker-compose up -d
echo "###### Waiting until containers are ready ######"
sleep 1
ID=$(docker ps --filter='name=fpe-homepage_db_1' -q)
while : ; do
docker exec $ID mysql -uroot -pexample -h127.0.0.1 -e 'show databases;' &> /dev/null
[[ $? -gt 0 ]] || break
echo "###### still waiting for mysql to finish initialization ######"
sleep 2
done
echo "###### Importing database dump ######"
./database/import-dump.sh
echo "###### Changing ownership in drupal to www-data ######"
DRUPAL_ID=$(docker ps --filter='name=fpe-homepage_drupal_1' -q)
docker exec $DRUPAL_ID bash -c 'chown -R www-data:www-data /var/www/html/sites'
echo "###### Changing ownership in grunt to node ######"
GRUNT_ID=$(docker ps --filter='name=fpe-homepage_grunt_1' -q)
docker exec $GRUNT_ID bash -c 'chown -R node:node /data'
echo "###### Fixing file permissions. Please provide your root password to do so. ######"
sudo chmod -R a+w sites themes modules
echo "###### Installation complete! Now go to http://localhost:8080 ######"