forked from ipeos-and-co/docker-spip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·41 lines (36 loc) · 899 Bytes
/
update.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
#!/bin/bash
set -euo pipefail
declare -A spipVersions=(
[0]='3.2'
[1]='4.0'
[2]='4.1'
)
declare -A phpVersions=(
[3.2]='7.4'
[4.0]='7.4'
[4.1]='8.1'
)
declare -A spipPackages=(
[3.2]='3.2.17'
[4.0]='4.0.9'
[4.1]='4.1.7'
)
declare -A mysqlPackages=(
[3.2]='mysqli'
[4.0]='mysqli'
[4.1]='mysqli'
)
for spipVersion in "${spipVersions[@]}"; do
mkdir -p "./${spipVersion}"
(
set -x
sed -r \
-e 's!%%PHP_VERSION%%!'"${phpVersions[$spipVersion]}"'!g' \
-e 's!%%SPIP_VERSION%%!'"${spipVersion}"'!g' \
-e 's!%%SPIP_PACKAGE%%!'"${spipPackages[$spipVersion]}"'!g' \
-e 's!%%MYSQL_PACKAGE%%!'"${mysqlPackages[$spipVersion]}"'!g' \
"Dockerfile${phpVersions[$spipVersion]}.tpl" > "./${spipVersion}/Dockerfile"
cp -a ./docker-entrypoint.sh "./${spipVersion}/docker-entrypoint.sh"
chmod +x "./${spipVersion}/docker-entrypoint.sh"
)
done