-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
36 lines (31 loc) · 708 Bytes
/
update.sh
File metadata and controls
36 lines (31 loc) · 708 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
#!/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 php.ini "$variant/php.ini"
sed -ri -e '
s/%%VARIANT%%/'"$variant"'/;
s/%%VERSION%%/'"$latest"'/;
s/%%CMD%%/'"${cmd[$variant]}"'/;
' "$variant/Dockerfile"
done