This repository has been archived by the owner on Oct 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·51 lines (40 loc) · 1.77 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
echo "Installing the Access My Info development environment."
echo "This may take several minutes."
# Check to see if Docker is installed
if ! [ -x "$(command -v docker-compose)" ]; then
echo 'Error: Docker is not installed. Please install Docker and re-run this script.' >&2
exit 1
fi
# Make sure we're in the project root folder.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
# Get the code for the frontend
git clone https://github.com/citizenlab/ami-frontend frontend/ami-code
cd frontend/ami-code
# Get the code for the community tools
cd $DIR
git clone https://github.com/citizenlab/ami-community community/ami-code
cd community/ami-code
mkdir jurisdiction_events
cd $DIR
# Set up the frontend config
cp ./frontend/ami-code/config/prod.json.default ./frontend/ami-code/config/prod.json
cp ./frontend/ami-code/config/dev.json.default ./frontend/ami-code/config/dev.json
# Set up community config
cp ./community/ami-code/conf/db.conf.js.default ./community/ami-code/conf/db.conf.js
cp ./community/ami-code/conf/policy.conf.js.default ./community/ami-code/conf/policy.conf.js
cp ./community/ami-code/conf/sendgrid.conf.js.default ./community/ami-code/conf/sendgrid.conf.js
# Set up and configure docker containers
cd $DIR
docker-compose build
docker-compose up -d
# Configure the CMS
echo "Waiting for two minutes to make sure the MYSQL database is ready to be linked to the WP install"
sleep 120
docker-compose run --rm setup /home/wp-ami-setup.sh
# Install database for community tools
docker-compose exec community /data/install.sh
# Output final step to take
echo "Installation almost complete. Log into the CMS at http://localhost:8080/wp-login.php and enable qTranslate-x plugin."
echo "After that, visit http://localhost:3333 to check out the AMI frontend."