Skip to content

Commit 8cb89f0

Browse files
committed
chore(docker): Handle classic image generation and generate for beta 1
1 parent 52b92f6 commit 8cb89f0

File tree

12 files changed

+152
-25
lines changed

12 files changed

+152
-25
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM prestashop/base:8.1-apache
2+
LABEL maintainer="PrestaShop Core Team <coreteam@prestashop.com>"
3+
4+
ENV PS_VERSION 9.0.0-beta.1-classic
5+
6+
# Get PrestaShop
7+
ADD https://github.com/PrestaShopCorp/PrestaShop-classic/releases/download/9.0.0-beta.1-classic/prestashop_9.0.0-beta.1-classic.zip /tmp/prestashop.zip
8+
9+
# Extract
10+
RUN mkdir -p /tmp/data-ps \
11+
&& unzip -q /tmp/prestashop.zip -d /tmp/data-ps/ \
12+
&& bash /tmp/ps-extractor.sh /tmp/data-ps \
13+
&& rm /tmp/prestashop.zip
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM prestashop/base:8.1-fpm
2+
LABEL maintainer="PrestaShop Core Team <coreteam@prestashop.com>"
3+
4+
ENV PS_VERSION 9.0.0-beta.1-classic
5+
6+
# Get PrestaShop
7+
ADD https://github.com/PrestaShopCorp/PrestaShop-classic/releases/download/9.0.0-beta.1-classic/prestashop_9.0.0-beta.1-classic.zip /tmp/prestashop.zip
8+
9+
# Extract
10+
RUN mkdir -p /tmp/data-ps \
11+
&& unzip -q /tmp/prestashop.zip -d /tmp/data-ps/ \
12+
&& bash /tmp/ps-extractor.sh /tmp/data-ps \
13+
&& rm /tmp/prestashop.zip
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM prestashop/base:8.2-apache
2+
LABEL maintainer="PrestaShop Core Team <coreteam@prestashop.com>"
3+
4+
ENV PS_VERSION 9.0.0-beta.1-classic
5+
6+
# Get PrestaShop
7+
ADD https://github.com/PrestaShopCorp/PrestaShop-classic/releases/download/9.0.0-beta.1-classic/prestashop_9.0.0-beta.1-classic.zip /tmp/prestashop.zip
8+
9+
# Extract
10+
RUN mkdir -p /tmp/data-ps \
11+
&& unzip -q /tmp/prestashop.zip -d /tmp/data-ps/ \
12+
&& bash /tmp/ps-extractor.sh /tmp/data-ps \
13+
&& rm /tmp/prestashop.zip
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM prestashop/base:8.2-fpm
2+
LABEL maintainer="PrestaShop Core Team <coreteam@prestashop.com>"
3+
4+
ENV PS_VERSION 9.0.0-beta.1-classic
5+
6+
# Get PrestaShop
7+
ADD https://github.com/PrestaShopCorp/PrestaShop-classic/releases/download/9.0.0-beta.1-classic/prestashop_9.0.0-beta.1-classic.zip /tmp/prestashop.zip
8+
9+
# Extract
10+
RUN mkdir -p /tmp/data-ps \
11+
&& unzip -q /tmp/prestashop.zip -d /tmp/data-ps/ \
12+
&& bash /tmp/ps-extractor.sh /tmp/data-ps \
13+
&& rm /tmp/prestashop.zip
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM prestashop/base:8.3-apache
2+
LABEL maintainer="PrestaShop Core Team <coreteam@prestashop.com>"
3+
4+
ENV PS_VERSION 9.0.0-beta.1-classic
5+
6+
# Get PrestaShop
7+
ADD https://github.com/PrestaShopCorp/PrestaShop-classic/releases/download/9.0.0-beta.1-classic/prestashop_9.0.0-beta.1-classic.zip /tmp/prestashop.zip
8+
9+
# Extract
10+
RUN mkdir -p /tmp/data-ps \
11+
&& unzip -q /tmp/prestashop.zip -d /tmp/data-ps/ \
12+
&& bash /tmp/ps-extractor.sh /tmp/data-ps \
13+
&& rm /tmp/prestashop.zip
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM prestashop/base:8.3-fpm
2+
LABEL maintainer="PrestaShop Core Team <coreteam@prestashop.com>"
3+
4+
ENV PS_VERSION 9.0.0-beta.1-classic
5+
6+
# Get PrestaShop
7+
ADD https://github.com/PrestaShopCorp/PrestaShop-classic/releases/download/9.0.0-beta.1-classic/prestashop_9.0.0-beta.1-classic.zip /tmp/prestashop.zip
8+
9+
# Extract
10+
RUN mkdir -p /tmp/data-ps \
11+
&& unzip -q /tmp/prestashop.zip -d /tmp/data-ps/ \
12+
&& bash /tmp/ps-extractor.sh /tmp/data-ps \
13+
&& rm /tmp/prestashop.zip
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM prestashop/base:8.4-apache
2+
LABEL maintainer="PrestaShop Core Team <coreteam@prestashop.com>"
3+
4+
ENV PS_VERSION 9.0.0-beta.1-classic
5+
6+
# Get PrestaShop
7+
ADD https://github.com/PrestaShopCorp/PrestaShop-classic/releases/download/9.0.0-beta.1-classic/prestashop_9.0.0-beta.1-classic.zip /tmp/prestashop.zip
8+
9+
# Extract
10+
RUN mkdir -p /tmp/data-ps \
11+
&& unzip -q /tmp/prestashop.zip -d /tmp/data-ps/ \
12+
&& bash /tmp/ps-extractor.sh /tmp/data-ps \
13+
&& rm /tmp/prestashop.zip
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM prestashop/base:8.4-fpm
2+
LABEL maintainer="PrestaShop Core Team <coreteam@prestashop.com>"
3+
4+
ENV PS_VERSION 9.0.0-beta.1-classic
5+
6+
# Get PrestaShop
7+
ADD https://github.com/PrestaShopCorp/PrestaShop-classic/releases/download/9.0.0-beta.1-classic/prestashop_9.0.0-beta.1-classic.zip /tmp/prestashop.zip
8+
9+
# Extract
10+
RUN mkdir -p /tmp/data-ps \
11+
&& unzip -q /tmp/prestashop.zip -d /tmp/data-ps/ \
12+
&& bash /tmp/ps-extractor.sh /tmp/data-ps \
13+
&& rm /tmp/prestashop.zip

prestashop_docker/generator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def __init__(self, directory_path, template, nightly_template, branch_template):
2424
self.download_url = 'https://www.prestashop.com/download/old/' \
2525
'prestashop_{}.zip'
2626
self.download_url_github = 'https://github.com/PrestaShop/PrestaShop/releases/download/{}/prestashop_{}.zip'
27+
self.download_url_github_classic = 'https://github.com/PrestaShopCorp/PrestaShop-classic/releases/download/{}/prestashop_{}.zip'
2728
self.directory_path = directory_path
2829
self.template = Template(template)
2930
self.nightly_template = Template(nightly_template)
@@ -92,7 +93,10 @@ def generate_image(self, ps_version, container_version):
9293
use_github_url = False
9394

9495
if use_github_url:
95-
ps_url = self.download_url_github.format(ps_version, ps_version)
96+
if parsed_version['flavor_versions'] == 'classic':
97+
ps_url = self.download_url_github_classic.format(ps_version, ps_version)
98+
else:
99+
ps_url = self.download_url_github.format(ps_version, ps_version)
96100
else:
97101
ps_url = self.download_url.format(ps_version)
98102
f.write(

prestashop_docker/version_manager.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,21 @@ def get_version_from_string(self, version):
9595
9696
@param version: The version you want
9797
@type version: str
98-
@return: A tuple containing ('PS_VERSION', 'BRANCH_VERSION', (PHP_VERSIONS), 'CONTAINER_TYPE')
99-
or ('PS_VERSION', 'BRANCH_VERSION', 'PHP_VERSION', 'CONTAINER_TYPE')
98+
@return: A tuple containing ('PS_VERSION', 'BRANCH_VERSION', (PHP_VERSIONS), 'CONTAINER_TYPE', 'FLAVOR_VERSION')
99+
or ('PS_VERSION', 'BRANCH_VERSION', 'PHP_VERSION', 'CONTAINER_TYPE', 'FLAVOR_VERSION')
100100
@rtype: tuple
101101
'''
102102
matches = self.parse_version_from_string(version)
103103
if not matches:
104104
return None
105105

106106
ps_version = matches.group('version')
107+
108+
flavor_versions = None
109+
if matches.group('flavor'):
110+
flavor_versions = matches.group('flavor')
111+
ps_version = ps_version + '-' + flavor_versions
112+
107113
if matches.group('php'):
108114
php_versions = (matches.group('php'),)
109115
else:
@@ -140,7 +146,8 @@ def get_version_from_string(self, version):
140146
'ps_version': ps_version,
141147
'branch_version': branch_version,
142148
'php_versions': php_versions,
143-
'container_version': container_version
149+
'container_version': container_version,
150+
'flavor_versions': flavor_versions
144151
}
145152

146153
def get_last_patch_from_version(self, version):
@@ -201,7 +208,7 @@ def parse_version_from_string(self, version):
201208
@return: Return None if no position in the string matches the pattern otherwise a Match object.
202209
@rtpe: None|Match
203210
'''
204-
regex = r"^(?P<version>(?:[0-9]+\.){0,3}(?:[0-9]+|nightly|x)(?:-(?:alpha|beta|rc)(?:\.\d+)?(?:\+\d+)?)?)(?:-(?P<php>\d+\.\d+))?(?:-(?P<container>fpm|apache))?$"
211+
regex = r"^(?P<version>(?:[0-9]+\.){0,3}(?:[0-9]+|nightly|x)(?:-(?:alpha|beta|rc)(?:\.\d+)?(?:\+\d+)?)?)(?:-(?P<flavor>classic))?(?:-(?P<php>\d+\.\d+))?(?:-(?P<container>fpm|apache))?$"
205212
return re.search(regex, version)
206213

207214
def get_aliases(self):

0 commit comments

Comments
 (0)