forked from t3n/docker-matomo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·38 lines (33 loc) · 812 Bytes
/
update.sh
File metadata and controls
executable file
·38 lines (33 loc) · 812 Bytes
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
#!/bin/bash
set -e
declare -A cmd=(
[apache]='apache2-foreground'
[fpm]='php-fpm'
[fpm-alpine]='php-fpm'
)
declare -A base=(
[apache]='debian'
[fpm]='debian'
[fpm-alpine]='alpine'
)
latest="$(
git ls-remote --tags https://github.com/matomo-org/matomo.git \
| cut -d/ -f3 \
| grep -vE -- '-rc|-a|-b' \
| sort -V \
| tail -1
)"
set -x
for variant in apache fpm fpm-alpine; do
template="Dockerfile-${base[$variant]}.template"
cp "$template" "$variant/Dockerfile"
cp docker-entrypoint.sh "$variant/docker-entrypoint.sh"
cp common.config.ini.php "$variant/common.config.ini.php"
cp php.ini "$variant/php.ini"
cp bootstrap.php "$variant/bootstrap.php"
sed -ri -e '
s/%%VARIANT%%/'"$variant"'/;
s/%%VERSION%%/'"$latest"'/;
s/%%CMD%%/'"${cmd[$variant]}"'/;
' "$variant/Dockerfile"
done