-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb-entrypoint.sh
executable file
·57 lines (46 loc) · 1.31 KB
/
web-entrypoint.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
52
53
54
55
56
#!/usr/bin/env bash
set -ex;
# 1ere version: 01/09/2017
# last version: 01/11/2017
# "Remi suinot <remi@suinot.org>"
# -------------------------------------
# reste à gerer les mises à jours de spip
# -------------------------------------
SPIP_VERSION="3.1"
SPIP_PACKAGE="3.1.6"
# SPIP -> les variables sont passé par docker-compose
# **** début des fonctions **** #
function installation {
curl -o spip.zip -fSL "files.spip.net/spip/archives/SPIP-v${SPIP_PACKAGE}.zip"
unzip -q spip.zip
rm spip.zip
chown -R www-data:www-data *
}
function mise_a_jour {
# le script ne fait que télécharger spip_loader
# a vous de l'utiliser une fois le container redémaré
# cf: https://www.spip.net/fr_article5705.html
curl -o spip_loader.php https://www.spip.net/spip-dev/INSTALL/spip_loader.php
chown www-data. spip_loader.php
}
#
# **** fin des fonctions **** #
# Install SPIP
cd /var/www/
if [ -d spip ]; then
# ok le répertoire existe
cd spip
if [ "$(ls -A ./ 2>&1)" = "" ]; then
# mais s'il est vide, on télécharge
cd ../
installation
else
# s'il est plein, on récupère spip_loader
mise_a_jour
fi
else
# pas de répertoire, nous sommes sur une première installation
installation
fi
echo "Starting nginx..."
exec $(which nginx) -c /etc/nginx/nginx.conf -g "daemon off;"