forked from PrestaShop/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_all.sh
executable file
·57 lines (47 loc) · 1.55 KB
/
generate_all.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
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
php_version_default="5.6-apache"
generate_image()
{
echo "Generate Dockerfile for PrestaShop $version - PHP $php_version"
if [ "${php_version}x" = "x" ]; then
folder="${version}";
php_version=$php_version_default
elif [ $version = "nightly" ]; then
folder="${version}-$php_version";
else
folder="${version:0:3}-$php_version";
fi
mkdir -p images/$folder/
if [ $version = "nightly" ]; then
sed '
s/{PS_VERSION}/'"$version"'/;
s/{PHP_VERSION}/'"$php_version"'/
' Dockerfile-nightly.model > images/$folder/Dockerfile
else
sed '
s/{PS_VERSION}/'"$version"'/;
s/{PHP_VERSION}/'"$php_version"'/;
s/{PS_URL}/'"https:\/\/www.prestashop.com\/download\/old\/prestashop_$version.zip"'/
' Dockerfile.model > images/$folder/Dockerfile
fi
}
if [ -z "$1" ]; then
ps_versions_file="versions.txt";
else
ps_versions_file="$1";
fi
# Generate images for all PrestaShop versions from 1.4 on PHP 5.6
echo "Reading versions in $ps_versions_file ..."
while read version; do
php_version=""
generate_image
done <$ps_versions_file
# Generate images for each major version of PrestaShop on different PHP environment
for php_version in "5.6-apache" "7.0-apache" "7.1-apache" "7.2-apache" "5.6-fpm" "7.0-fpm" "7.1-fpm" "7.2-fpm"
do
for major_version in "15" "16" "17" "nightly"
do
version=$(grep "." versions$major_version.txt | tail -1)
generate_image
done
done