Skip to content

Commit

Permalink
Merge pull request #98 from shopware/use-deployment-helper-when-avail…
Browse files Browse the repository at this point in the history
…able

feat: use deployment helper when available
  • Loading branch information
shyim authored Aug 2, 2024
2 parents c7833ef + faf8a86 commit 0486172
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 25 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ jobs:
cache-to: type=registry,ref=ghcr.io/shopware/docker-cache:${{ matrix.php }}-caddy,mode=max
platforms: linux/amd64,linux/arm64
build-args: |
PHP_PATCH_VERSION=${{ matrix.phpPatch }}
PHP_DIGEST=${{ matrix.phpPatchDigest }}
SUPERVISORD_DIGEST=${{ matrix.supervisordDigest }}
FPM_IMAGE=${{ matrix.fpm-image }}
push: true
provenance: false

Expand Down Expand Up @@ -199,23 +197,31 @@ jobs:
repository: shopwareLabs/example-docker-repository

- name: Build
id: build
uses: docker/build-push-action@v6
with:
push: false
load: true
build-args: |
BASE_IMAGE=ghcr.io/shopware/docker-base-ci-test:${{ github.run_id }}-8.3-caddy
context: .
file: Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
run: docker compose build --build-arg BASE_IMAGE=ghcr.io/shopware/docker-base-ci-test:${{ github.run_id }}-8.3-caddy
env:
DOCKER_BUILDKIT: 0

- name: Run image
env:
DOCKER_BUILDKIT: 0
run: docker compose up -d --wait

- name: Wait for Webserver reachable
run: |
attempt_counter=0
max_attempts=5
until $(curl --output /dev/null --silent --head --fail localhost:8000/admin); do
if [ ${attempt_counter} -eq ${max_attempts} ];then
echo "Max attempts reached"
exit 1
fi
printf '.'
attempt_counter=$(($attempt_counter+1))
sleep 5
done
- name: Check if shopware is running
run: curl --fail localhost:8000/admin

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## 2024-08-02

Deprecated the installation and update scripts that were previously included in the repository.
They will be removed November 2024, [use the Deployment Helper](https://developer.shopware.com/docs/guides/hosting/installation-updates/deployments/deployment-helper.html) as a replacement.
4 changes: 2 additions & 2 deletions caddy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#syntax=docker/dockerfile:1.4

ARG PHP_PATCH_VERSION
ARG FPM_IMAGE=ghcr.io/shopware/docker-base:8.3.1-fpm

FROM ghcr.io/shopware/docker-base:${PHP_PATCH_VERSION}-fpm
FROM ${FPM_IMAGE}

Check failure on line 5 in caddy/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Dockerfiles

DL3006 warning: Always tag the version of an image explicitly

USER root

Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "shopware/docker",
"type": "metapackage",
"license": "MIT",
"description": "Docker image for Shopware 6 production"
}
"name": "shopware/docker",
"type": "metapackage",
"license": "MIT",
"description": "Docker image for Shopware 6 production",
"require": {
"shopware/deployment-helper": "*"
}
}
19 changes: 18 additions & 1 deletion fpm/rootfs/setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
#!/usr/bin/env sh

set -e
set -x

if [[ -e /var/www/html/vendor/bin/shopware-deployment-helper ]]; then
cd /var/www/html
exec ./vendor/bin/shopware-deployment-helper run
fi

echo "### DEPRECATION ###"
echo ""
echo "### The setup scripts are deprecated and will be removed November 2024 ###"
echo "### Please install the Shopware Deployment Helper using composer require shopware/deployment-helper to get rid of this message ###"
echo "### For more information see https://developer.shopware.com/docs/guides/hosting/installation-updates/deployments/deployment-helper.html ###"
echo ""
echo "### DEPRECATION ###"
echo ""
echo "Sleeping 30 seconds to make the deprecation visible."

sleep 30

set -x

shopware_version=$(jq '.packages[] | select (.name == "shopware/core") | .version' -r < composer.lock)
# shellcheck disable=SC2081,SC3010
Expand Down
3 changes: 0 additions & 3 deletions matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ function get_digest_of_image(string $imageName, string $tag): string {

$versionRegex ='/^(?<version>\d\.\d\.\d{1,}(RC\d)?)/m';

$supervisord = get_digest_of_image('shyim/supervisord', 'latest');


foreach ($supportedVersions as $supportedVersion)
{
Expand Down Expand Up @@ -100,7 +98,6 @@ function get_digest_of_image(string $imageName, string $tag): string {
'php' => $supportedVersion,
'phpPatch' => $patchVersion['version'],
'phpPatchDigest' => $phpDigest,
'supervisordDigest' => $supervisord,
'base-image' => 'ghcr.io/shopware/docker-base' . $imageSuffix . ':' . $imageTagPrefix . $supportedVersion,
'fpm-image' => 'ghcr.io/shopware/docker-base' . $imageSuffix . ':' . $imageTagPrefix . $supportedVersion . '-fpm',
'fpm-patch-image' => 'ghcr.io/shopware/docker-base' . $imageSuffix . ':' . $imageTagPrefix . $patchVersion['version'] . '-fpm',
Expand Down

0 comments on commit 0486172

Please sign in to comment.