-
Notifications
You must be signed in to change notification settings - Fork 18
/
run.sh
executable file
·48 lines (36 loc) · 1.07 KB
/
run.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
#! /bin/bash
set -e
if [ ! -d "app/vendor" ]; then
./composer.sh install --ignore-platform-reqs
fi
if [ ! -d "app/node_modules" ]; then
./npm.sh install
fi
if [ ! -d "app/dist" ]; then
./npm.sh run build
fi
if [ ! -f "db_password.txt" ]; then
dd if=/dev/urandom bs=64 count=1 | base64 > ./db_password.txt
dd if=/dev/urandom bs=64 count=1 | base64 > ./db_root_password.txt
fi
if [ ! -d "db_data" ]; then
mkdir db_data
fi
if [ ! -d "db_blob" ]; then
mkdir db_blob
fi
if [ ! -f "db_blob_access_key.txt" ]; then
dd if=/dev/urandom bs=15 count=1 | base64 | sed -e 's/\//0/' > ./db_blob_access_key.txt
dd if=/dev/urandom bs=30 count=1 | base64 | sed -e 's/\//0/' > ./db_blob_secret_key.txt
fi
if [ ! -d "mail" ]; then
mkdir mail
fi
if [ ! -f "tilmeld_secret.txt" ]; then
dd if=/dev/urandom bs=32 count=1 | base64 > ./tilmeld_secret.txt
fi
if [ ! -f "onesignal_rest_api_key.txt" ]; then
echo "In order to test app push notifications, you need to put your OneSignal REST API Key in onesignal_rest_api_key.txt."
touch ./onesignal_rest_api_key.txt
fi
docker-compose up $*