-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathinitnc.sh
executable file
·50 lines (40 loc) · 1.36 KB
/
initnc.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
#!/bin/sh
export BRANCH=${BRANCH:=master}
# Where we do all the work
cd /var/www/html/
# Update code
su www-data -c "
git fetch origin
git checkout ${BRANCH}
git pull
git submodule update
# Creating data
mkdir -p /var/www/html/data
# Init
php occ maintenance:install --admin-user=admin --admin-pass=admin
OC_PASS=test php occ user:add --password-from-env -- test
# Trusted domains
php occ config:system:set trusted_domains 1 --value=*
php occ config:system:set loglevel --value='0'
"
# allow eval script for executing javascript in webview (LoginIT test for Android)
# it needs EVAL set to true within environment in .drone.yml
if test -z "$EVAL"
then
echo "\$EVAL not set, ignoring..."
else
echo "\$EVAL is set, allowing eval script in ContentSecurityPolicy.php"
sed -i s'/protected $evalScriptAllowed = false;/protected $evalScriptAllowed = true;/' lib/public/AppFramework/Http/ContentSecurityPolicy.php
fi
if test -z "$REDIS"
then
echo "\$REDIS not set, ignoring..."
else
su www-data -c "
php occ config:system:set redis host --value=${REDIS}
php occ config:system:set redis port --value=6379 --type=integer
php occ config:system:set redis timeout --value=0 --type=integer
php occ config:system:set --type string --value '\\OC\\Memcache\\Redis' memcache.local
php occ config:system:set --type string --value '\\OC\\Memcache\\Redis' memcache.distributed
"
fi