Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Jan 25, 2024
1 parent feab9f5 commit a67b262
Show file tree
Hide file tree
Showing 20 changed files with 261 additions and 236 deletions.
256 changes: 26 additions & 230 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ name: Build
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "Dockerfile.template"
- ".github/workflows/build.yml"
- "rootfs/**"
pull_request:

env:
DOCKER_BUILDKIT: 1
Expand All @@ -19,243 +14,44 @@ permissions:
packages: write

jobs:
php81-arm64:
name: 8.1 on ARM64
runs-on: hcloud-arm64-small
steps:
- uses: actions/checkout@v3

- name: Install Cosign
uses: sigstore/cosign-installer@v3

- name: Login into Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin

- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- uses: docker/build-push-action@v4
with:
tags: ghcr.io/shopware/docker-base:8.1.26-arm64
context: .
file: 8.1/Dockerfile
cache-from: type=registry,ref=ghcr.io/shopware/docker-cache:8.1-arm64
cache-to: type=registry,ref=ghcr.io/shopware/docker-cache:8.1-arm64,mode=max
platforms: linux/arm64
push: true
provenance: false

php81-amd64:
name: 8.1 on AMD64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Install Cosign
uses: sigstore/cosign-installer@v3

- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- uses: docker/build-push-action@v4
with:
tags: ghcr.io/shopware/docker-base:8.1.26-amd64
context: .
file: 8.1/Dockerfile
cache-from: type=registry,ref=ghcr.io/shopware/docker-cache:8.1-amd64
cache-to: type=registry,ref=ghcr.io/shopware/docker-cache:8.1-amd64,mode=max
platforms: linux/amd64
push: true
provenance: false

php82-arm64:
name: 8.2 on ARM64
runs-on: hcloud-arm64-small
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3

- name: Install Cosign
uses: sigstore/cosign-installer@v3
- name: Checkout
uses: actions/checkout@v4

- name: Login into Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin

- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- uses: docker/build-push-action@v4
with:
tags: ghcr.io/shopware/docker-base:8.2.14-arm64
context: .
file: 8.2/Dockerfile
cache-from: type=registry,ref=ghcr.io/shopware/docker-cache:8.2-arm64
cache-to: type=registry,ref=ghcr.io/shopware/docker-cache:8.2-arm64,mode=max
platforms: linux/arm64
push: true
provenance: false

php82-amd64:
name: 8.2 on AMD64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Generate Matrix
id: generate-matrix
run: |
MATRIX=$(php matrix.php)
echo "matrix<<EOF" >> $GITHUB_OUTPUT
echo "$MATRIX" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Install Cosign
uses: sigstore/cosign-installer@v3

- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- uses: docker/build-push-action@v4
with:
tags: ghcr.io/shopware/docker-base:8.2.14-amd64
context: .
file: 8.2/Dockerfile
cache-from: type=registry,ref=ghcr.io/shopware/docker-cache:8.2-amd64
cache-to: type=registry,ref=ghcr.io/shopware/docker-cache:8.2-amd64,mode=max
platforms: linux/amd64
push: true
provenance: false

php83-arm64:
name: 8.3 on ARM64
runs-on: hcloud-arm64-small
build-fpm-amd64:
name: Build FPM AMD64
runs-on: ubuntu-latest
needs: [generate-matrix]
strategy: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3

- name: Install Cosign
uses: sigstore/cosign-installer@v3
- name: Checkout
uses: actions/checkout@v4

- name: Login into Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin

- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- uses: docker/build-push-action@v4
with:
tags: ghcr.io/shopware/docker-base:8.3.1-arm64
tags: ghcr.io/shopware/docker-base-fpm:${{ matrix.php }}-amd64
context: .
file: 8.3/Dockerfile
cache-from: type=registry,ref=ghcr.io/shopware/docker-cache:8.3-arm64
cache-to: type=registry,ref=ghcr.io/shopware/docker-cache:8.3-arm64,mode=max
file: ${{ matrix.php }}/Dockerfile
cache-from: type=registry,ref=ghcr.io/shopware/docker-cache:${{ matrix.php }}-fpm-amd64
cache-to: type=registry,ref=ghcr.io/shopware/docker-cache:${{ matrix.php }}-fpm-amd64,mode=max
platforms: linux/arm64
push: true
push: false
provenance: false

php83-amd64:
name: 8.3 on AMD64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Install Cosign
uses: sigstore/cosign-installer@v3

- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- uses: docker/build-push-action@v4
with:
tags: ghcr.io/shopware/docker-base:8.3.1-amd64
context: .
file: 8.3/Dockerfile
cache-from: type=registry,ref=ghcr.io/shopware/docker-cache:8.3-amd64
cache-to: type=registry,ref=ghcr.io/shopware/docker-cache:8.3-amd64,mode=max
platforms: linux/amd64
push: true
provenance: false


merge-manifest:
name: Merge Manifest
runs-on: ubuntu-latest
needs:
- php81-arm64
- php81-amd64
- php82-arm64
- php82-amd64
- php83-arm64
- php83-amd64

steps:
- name: Login into Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin

- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Install Cosign
uses: sigstore/cosign-installer@v3

- name: Install Regclient
run: |
wget https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64
chmod +x regctl-linux-amd64
- run: docker manifest create ghcr.io/shopware/docker-base:8.1 --amend ghcr.io/shopware/docker-base:8.1.26-amd64 --amend ghcr.io/shopware/docker-base:8.1.26-arm64

- run: docker manifest create ghcr.io/shopware/docker-base:8.1.26 --amend ghcr.io/shopware/docker-base:8.1.26-amd64 --amend ghcr.io/shopware/docker-base:8.1.26-arm64

- run: docker manifest push ghcr.io/shopware/docker-base:8.1

- run: docker manifest push ghcr.io/shopware/docker-base:8.1.26

- run: cosign sign --yes ghcr.io/shopware/docker-base:8.1

- run: cosign sign --yes ghcr.io/shopware/docker-base:8.1.26

- run: ./regctl-linux-amd64 image copy ghcr.io/shopware/docker-base:8.1 shopware/docker-base:8.1

- run: ./regctl-linux-amd64 image copy ghcr.io/shopware/docker-base:8.1.26 shopware/docker-base:8.1.26

- run: docker manifest create ghcr.io/shopware/docker-base:8.2 --amend ghcr.io/shopware/docker-base:8.2.14-amd64 --amend ghcr.io/shopware/docker-base:8.2.14-arm64

- run: docker manifest create ghcr.io/shopware/docker-base:8.2.14 --amend ghcr.io/shopware/docker-base:8.2.14-amd64 --amend ghcr.io/shopware/docker-base:8.2.14-arm64

- run: docker manifest push ghcr.io/shopware/docker-base:8.2

- run: docker manifest push ghcr.io/shopware/docker-base:8.2.14

- run: cosign sign --yes ghcr.io/shopware/docker-base:8.2

- run: cosign sign --yes ghcr.io/shopware/docker-base:8.2.14

- run: ./regctl-linux-amd64 image copy ghcr.io/shopware/docker-base:8.2 shopware/docker-base:8.2

- run: ./regctl-linux-amd64 image copy ghcr.io/shopware/docker-base:8.2.14 shopware/docker-base:8.2.14

- run: docker manifest create ghcr.io/shopware/docker-base:8.3 --amend ghcr.io/shopware/docker-base:8.3.1-amd64 --amend ghcr.io/shopware/docker-base:8.3.1-arm64

- run: docker manifest create ghcr.io/shopware/docker-base:8.3.1 --amend ghcr.io/shopware/docker-base:8.3.1-amd64 --amend ghcr.io/shopware/docker-base:8.3.1-arm64

- run: docker manifest push ghcr.io/shopware/docker-base:8.3

- run: docker manifest push ghcr.io/shopware/docker-base:8.3.1

- run: cosign sign --yes ghcr.io/shopware/docker-base:8.3

- run: cosign sign --yes ghcr.io/shopware/docker-base:8.3.1

- run: ./regctl-linux-amd64 image copy ghcr.io/shopware/docker-base:8.3 shopware/docker-base:8.3

- run: ./regctl-linux-amd64 image copy ghcr.io/shopware/docker-base:8.3.1 shopware/docker-base:8.3.1

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ run_hooks() {
hook=$1
if [ -d "/usr/local/shopware/$hook.d" ]; then
for file in "/usr/local/shopware/$hook.d"/*.sh; do
echo "Running $file for $hook"
# shellcheck source=/dev/null
. "$file"
done
echo "Running $file for $hook"
# shellcheck source=../../../../../../../../../dev/null
. "$file"
done
fi
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ if console system:is-installed; then
run_hooks pre_update

if [ "${SHOPWARE_SKIP_ASSET_COPY-""}" ]; then
console system:update:finish --skip-asset-build
console system:update:finish --skip-asset-build
else
console system:update:finish
console system:update:finish
fi

if [ "${SHOPWARE_SKIP_ASSET_COPY-""}" ]; then
Expand Down
15 changes: 15 additions & 0 deletions fpm/rootfs/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env sh

set -e
set -x

shopware_version=$(jq '.packages[] | select (.name == "shopware/core") | .version' -r < composer.lock)
# if shopware version starts with 6.6 echo 6.6
# shellcheck disable=SC2081,SC3010
if [[ $shopware_version == v6.6.* ]]; then
# shellcheck source-path=./rootfs source=./usr/local/shopware/setup_6.6.x
. /usr/local/shopware/setup_6.6.x
else
# shellcheck source-path=./rootfs source=./usr/local/shopware/setup_6.5.x
. /usr/local/shopware/setup_6.5.x
fi
18 changes: 18 additions & 0 deletions fpm/rootfs/usr/local/etc/php-fpm.d/docker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[global]
daemonize = no
error_log = /proc/self/fd/2

; https://github.com/docker-library/php/pull/725#issuecomment-443540114
log_limit = 8192

[www]
listen = /tmp/php-fpm.sock
clear_env = no
pm = ${FPM_PM}
pm.max_children = ${FPM_PM_MAX_CHILDREN}
pm.start_servers = ${FPM_PM_START_SERVERS}
pm.min_spare_servers = ${FPM_PM_MIN_SPARE_SERVERS}
pm.max_spare_servers = ${FPM_PM_MAX_SPARE_SERVERS}
catch_workers_output = yes
decorate_workers_output = no
access.log = /dev/null
15 changes: 15 additions & 0 deletions fpm/rootfs/usr/local/etc/php/conf.d/docker.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
upload_max_filesize = ${PHP_MAX_UPLOAD_SIZE}
post_max_size = ${PHP_MAX_UPLOAD_SIZE}
max_execution_time = ${PHP_MAX_EXECUTION_TIME}
memory_limit = ${PHP_MEMORY_LIMIT}

session.save_handler = ${PHP_SESSION_HANDLER}
session.save_path = ${PHP_SESSION_SAVE_PATH}
error_reporting = ${PHP_ERROR_REPORTING}
zend.assertions = -1
opcache.interned_strings_buffer=20
opcache.enable_file_override=1
opcache.validate_timestamps=0
zend.detect_unicode=0
realpath_cache_ttl=3600
expose_php = Off
Loading

0 comments on commit a67b262

Please sign in to comment.