-
Notifications
You must be signed in to change notification settings - Fork 0
/
bioman-automations
30 lines (24 loc) · 1.18 KB
/
bioman-automations
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
#!/command/with-contenv bash
# Exit on error
set -e
# Check to see if the bioman CLI exists and assume it means bioman is configured
if [ -f $WEBUSER_HOME/bioman ] && [ ${AUTORUN_ENABLED:="true"} == "true" ]; then
echo "🏃♂️ Checking for automations..."
############################################################################
# Automated file ownership fix
############################################################################
if [ ${AUTORUN_BIOMAN_FILE_OWNERSHIP:="true"} == "true" ]; then
echo "🔐 Fixing file ownership..."
chown -R webuser:webgroup $WEBUSER_HOME
fi
############################################################################
# Automated database upgrade
############################################################################
if [ ${AUTORUN_BIOMAN_DATABASE_UPGRADE:="true"} == "true" ]; then
echo "🚀 Running database upgrade..."
s6-setuidgid webuser php $WEBUSER_HOME/bioman migrate
fi
else
echo "👉 Skipping automations because we could not detect a bioman install or it was specifically disabled..."
fi
exit 0