@@ -19,21 +19,33 @@ declare -A base=(
19
19
[fpm-alpine]=' alpine'
20
20
)
21
21
22
- latest=" $( curl -fsSL ' https://www.phpmyadmin.net/home_page/version.json' | jq -r ' .version' ) "
23
- sha256=" $( curl -fsSL " https://files.phpmyadmin.net/phpMyAdmin/$latest /phpMyAdmin-$latest -all-languages.tar.xz.sha256" | cut -f1 -d ' ' | tr -cd ' a-f0-9' | cut -c 1-64) "
22
+ function create_variant() {
23
+ local variant=" $1 "
24
+ local version=" $2 "
25
+ local sha256=" $3 "
24
26
25
- for variant in apache fpm fpm-alpine; do
26
- template=" Dockerfile-${base[$variant]} .template"
27
- cp $template " $variant /Dockerfile"
27
+ local branch=" $( sed -ne ' s/^\([0-9]*\.[0-9]*\)\..*$/\1/p' <<< " $version" ) "
28
+
29
+ echo " updating $version [$branch ] $variant "
30
+
31
+ local template=" Dockerfile-${base[$variant]} .template"
32
+ cp " $template " " $variant /Dockerfile"
28
33
cp config.inc.php " $variant /config.inc.php"
29
34
cp docker-entrypoint.sh " $variant /docker-entrypoint.sh"
30
35
sed -ri -e '
31
- s/%%VERSION%%/' " $latest " ' /;
36
+ s/%%VERSION%%/' " $version " ' /;
32
37
s/%%SHA256%%/' " $sha256 " ' /;
33
38
s/%%VARIANT%%/' " $variant " ' /;
34
39
s/%%CMD%%/' " ${cmd[$variant]} " ' /;
35
40
' " $variant /Dockerfile"
36
41
if [ " $variant " != " apache" ]; then
37
42
sed -i " /^# start: Apache specific settings$/,/^# end: Apache specific settings$/d" " $variant /docker-entrypoint.sh"
38
43
fi
44
+ }
45
+
46
+ latest=" $( curl -fsSL ' https://www.phpmyadmin.net/home_page/version.json' | jq -r ' .version' ) "
47
+ sha256=" $( curl -fsSL " https://files.phpmyadmin.net/phpMyAdmin/$latest /phpMyAdmin-$latest -all-languages.tar.xz.sha256" | cut -f1 -d ' ' | tr -cd ' a-f0-9' | cut -c 1-64) "
48
+
49
+ for variant in apache fpm fpm-alpine; do
50
+ create_variant " $variant " " $latest " " $sha256 "
39
51
done
0 commit comments