Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): New system #1

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!./assets
!./php-flavours.json
!./prestashop-versions.json
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
# this is good for diff and version control systems
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[{Makefile,makefile,**.mk}]
indent_style = tab
indent_size = 4

18 changes: 0 additions & 18 deletions .github/workflows/flake8.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/nose.yml

This file was deleted.

48 changes: 35 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,52 @@ name: Publish containers

on:
push:
branches: master
branches: [ "master" ]
pull_request:
branches: [ "master" ]

# TODO: nightly -> cron ?

env:
REGISTRY: docker.io
PLATFORM: 'linux/amd64,linux/arm64'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
with:
python-version: 3.8
use: true
platforms: ${{ env.PLATFORM }}

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Install dependencies
run: pip install -r requirements.txt
shell: bash
run: apt install jq curl

- name: Build Docker images
run: ./prestashop_docker.py --quiet tag build
shell: bash
run: ./build.sh

- name: Push Docker images
run: ./prestashop_docker.py --quiet tag push
if: ${{ github.event_name != 'pull_request' }}
shell: bash
run: |
echo "WIP"
docker image ls
56 changes: 56 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Pull Request
on:
pull_request:
types: [opened, reopened, synchronize]

env:
TARGET_PLATFORM: "linux/amd64" # TODO: 'linux/amd64,linux/arm64,linux/arm' ? 32 bits ?


jobs:
lint_shell:
name: "Lint: shell"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
ignore_paths: ./assets/docker_run.sh

lint_dockerfile:
name: "Lint: dockerfile"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
with:
recursive: true
dockerfile: "*.Dockerfile"

docker_build:
name: "Docker build: ${{ matrix.os_flavour }} for ${{ matrix.ps_version }} with ${{ matrix.server_flavour }}"
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false # TODO: Test only should be removed
matrix:
os_flavour: ["alpine", "debian"]
ps_version: ["1.6.1.24", "1.7.8.10", "8.1.6", 'nightly']
server_flavour: ["fpm", "nginx", "apache"]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Call the docker build chain
run: ./build.sh
env:
OS_FLAVOUR: ${{ matrix.os_flavour }}
PS_VERSION: ${{ matrix.ps_version }}
SERVER_FLAVOUR: ${{ matrix.server_flavour }}
TARGET_PLATFORM: ${{ env.TARGET_PLATFORM }}

- name: Test the image
run: docker run --rm -t --env PS_DOMAIN='localhost:80' --entrypoint sh $DOCKER_IMAGE -c 'cat VERSION'
env:
DOCKER_IMAGE: prestashop/prestashop:${{ matrix.ps_version }}-${{ matrix.os_flavour }}
21 changes: 12 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
extracts/*
dist
*.egg-info
.eggs
cover
.coverage

*.pyc
cache.sqlite
.idea
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
.history/
*~
.DS_Store
.*.swp
.env
9 changes: 9 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ignored:
- DL3006
- DL3008
- DL3009
- DL3018
- DL4006
- DL4001
- SC1091
- SC2086
4 changes: 4 additions & 0 deletions .sonarlint/connectedMode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"sonarCloudOrganization": "prestashopcorp",
"projectKey": "PrestaShopCorp_prestashop-docker"
}
20 changes: 0 additions & 20 deletions Dockerfile-nightly.model

This file was deleted.

13 changes: 0 additions & 13 deletions Dockerfile.model

This file was deleted.

62 changes: 0 additions & 62 deletions HOW-TO-USE.md

This file was deleted.

3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 PrestaShop
Copyright (c) 2019-2023 PrestaShop

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Loading
Loading