-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathupdate.sh
executable file
·47 lines (42 loc) · 1.04 KB
/
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
42
43
44
45
46
47
#!/bin/bash
set -euo pipefail
declare -A spipVersions=(
[0]='4.1'
[1]='4.2'
[2]='4.3'
[3]='4.4'
)
# Blocker en 8.2 max a cause du bug imagick et php 8.3 docker
# cf.https://orkhan.dev/2024/02/07/using-imagick-with-php-83-on-docker/
declare -A phpVersions=(
[4.1]='8.1'
[4.2]='8.3'
[4.3]='8.3'
[4.4]='8.3'
)
declare -A osVersions=(
[4.1]='bullseye'
[4.2]='bookworm'
[4.3]='bookworm'
[4.4]='bookworm'
)
declare -A spipPackages=(
[4.1]='4.1.20'
[4.2]='4.2.17'
[4.3]='4.3.8'
[4.4]='4.4.2'
)
for spipVersion in "${spipVersions[@]}"; do
mkdir -p "./${spipVersion}"
(
set -x
sed -r \
-e 's!%%PHP_VERSION%%!'"${phpVersions[$spipVersion]}"'!g' \
-e 's!%%OS_VERSION%%!'"${osVersions[$spipVersion]}"'!g' \
-e 's!%%SPIP_VERSION%%!'"${spipVersion}"'!g' \
-e 's!%%SPIP_PACKAGE%%!'"${spipPackages[$spipVersion]}"'!g' \
"Dockerfile.tpl" > "./${spipVersion}/Dockerfile"
cp -a ./docker-entrypoint.sh "./${spipVersion}/docker-entrypoint.sh"
chmod +x "./${spipVersion}/docker-entrypoint.sh"
)
done