diff --git a/Dockerfile-branch.model b/Dockerfile-branch.model new file mode 100644 index 00000000..5cd6ff87 --- /dev/null +++ b/Dockerfile-branch.model @@ -0,0 +1,9 @@ +FROM prestashop/base:$container_version +LABEL maintainer="PrestaShop Core Team " + +RUN apt update +RUN apt -y install git + +RUN git clone -b $ps_version https://github.com/PrestaShop/PrestaShop.git /tmp/data-ps + +CMD ["/tmp/docker_run.sh"] diff --git a/prestashop_docker.py b/prestashop_docker.py index 3e91eddc..032a2586 100755 --- a/prestashop_docker.py +++ b/prestashop_docker.py @@ -90,7 +90,8 @@ def main(): generator = Generator( path.join(path.dirname(path.realpath(__file__)), 'images'), open('./Dockerfile.model').read(), - open('./Dockerfile-nightly.model').read() + open('./Dockerfile-nightly.model').read(), + open('./Dockerfile-branch.model').read() ) generator.generate_all(VERSIONS) elif args.subcommand == 'tag': diff --git a/prestashop_docker/generator.py b/prestashop_docker/generator.py index db253b5e..b272e19a 100644 --- a/prestashop_docker/generator.py +++ b/prestashop_docker/generator.py @@ -8,7 +8,7 @@ class Generator: NIGHTLY = 'nightly' - def __init__(self, directory_path, template, nightly_template): + def __init__(self, directory_path, template, nightly_template, branch_template): """Constructor @param directory_path: Directory path @@ -17,6 +17,8 @@ def __init__(self, directory_path, template, nightly_template): @type template: str @param nightly_template: Nightly template @type nightly_template: str + @param branch_template: Branch template + @type branch_template: str """ self.download_url = 'https://www.prestashop.com/download/old/' \ 'prestashop_{}.zip' @@ -24,6 +26,7 @@ def __init__(self, directory_path, template, nightly_template): self.directory_path = directory_path self.template = Template(template) self.nightly_template = Template(nightly_template) + self.branch_template = Template(branch_template) def create_directory(self, directory_path): """Try to create a directory if it's possible @@ -57,6 +60,8 @@ def generate_image(self, ps_version, container_version): file_path = path.join(directory_path, 'Dockerfile') template = self.nightly_template if ( ps_version == self.NIGHTLY + ) else self.branch_template if ( + ps_version.endswith('.x') ) else self.template with open(file_path, 'w+') as f: diff --git a/versions.py b/versions.py index c7d2bab8..0456f74f 100644 --- a/versions.py +++ b/versions.py @@ -261,6 +261,11 @@ '8.0', '8.1', ), + '9.0.x': ( + '8.1', + '8.2', + '8.3', + ), 'nightly': ( '8.1', '8.2',