Skip to content

Commit 864ea69

Browse files
authored
[Actions] Prepare for first release (#105)
* [Actions] Consolidate building and release workflows * Create a tag for major version only as well, e.g. php8.1-v1 and use `v` prefix * Added readme & versioning in build script
1 parent ceb22dc commit 864ea69

File tree

3 files changed

+72
-117
lines changed

3 files changed

+72
-117
lines changed

.github/workflows/nightly.yml

Lines changed: 0 additions & 101 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker RELEASE
1+
name: Docker Build & Release
22

33
on:
44
workflow_dispatch:
@@ -10,7 +10,8 @@ on:
1010

1111
env:
1212
IMAGE_NAME: pimcore/pimcore
13-
LATEST_TAG: main
13+
LATEST_TAG: 1.0
14+
DEV_BRANCH: 1.x
1415

1516
jobs:
1617
build-php:
@@ -22,7 +23,7 @@ jobs:
2223
php: [ '8.0', '8.1' ]
2324
distro: [ bullseye ]
2425
target: [ fpm, debug, supervisord ]
25-
tag: [ 'main' ]
26+
tag: [ '1.x', '1.0' ]
2627

2728
steps:
2829
- uses: actions/checkout@v3
@@ -54,7 +55,12 @@ jobs:
5455
DOCKER_PLATFORMS=linux/amd64,linux/arm64
5556
PHP_VERSION=${{ matrix.php }}
5657
DEBIAN_VERSION="${{ matrix.distro }}"
57-
VERSION="${{ matrix.tag }}"
58+
VERSION="v${{ matrix.tag }}"
59+
# for the latest dev branch we use "dev" as the version and not the name of the branch
60+
if [ $DEV_BRANCH = "${{ matrix.tag }}" ]; then
61+
VERSION="dev"
62+
fi
63+
5864
PHP_SUB_VERSION=$(docker run -i --rm php:${{ matrix.php }}-fpm-${{ matrix.distro }} php -r 'echo PHP_VERSION;')
5965
6066
if [ "${{ matrix.target }}" = "fpm" ]; then
@@ -68,14 +74,34 @@ jobs:
6874
TAG="${BASE_TAG}-${VERSION}"
6975
TAG_DETAILED="${BASE_TAG_DETAILED}-${VERSION}"
7076
TAGS="--tag ${IMAGE_NAME}:${TAG}"
71-
7277
TAGS="$TAGS --tag ${IMAGE_NAME}:${TAG_DETAILED}"
7378
7479
# Tag latest with Version build too
7580
if [ $LATEST_TAG = "${{ matrix.tag }}" ]; then
7681
TAGS="$TAGS --tag ${IMAGE_NAME}:${BASE_TAG}-latest"
7782
fi
7883
84+
# Create tag for major version
85+
if [[ $VERSION =~ ^v[0-9]+.[0-9]+$ ]]; then
86+
VERSION_MAJOR=${VERSION//.[0-9]/}
87+
TAGS="$TAGS --tag ${IMAGE_NAME}:${BASE_TAG}-${VERSION_MAJOR}"
88+
fi
89+
90+
# BC Layer for tags before we introduced versioning
91+
# They use uppercase "PHP" in tag name and always used the latest dev branch
92+
if [ $DEV_BRANCH = "${{ matrix.tag }}" ]; then
93+
if [ "${{ matrix.target }}" = "debug" ]; then
94+
TAGS="$TAGS --tag ${IMAGE_NAME}:PHP${{ matrix.php }}-fpm-debug"
95+
TAGS="$TAGS --tag ${IMAGE_NAME}:PHP${{ matrix.php }}-cli-debug"
96+
elif [ "${{ matrix.target }}" = "fpm" ]; then
97+
TAGS="$TAGS --tag ${IMAGE_NAME}:PHP${{ matrix.php }}-cli"
98+
TAGS="$TAGS --tag ${IMAGE_NAME}:PHP${{ matrix.php }}-fpm"
99+
elif [ "${{ matrix.target }}" = "supervisord" ]; then
100+
TAGS="$TAGS --tag ${IMAGE_NAME}:PHP${{ matrix.php }}-supervisord"
101+
fi
102+
fi
103+
104+
79105
echo ::set-output name=tag::${TAG}
80106
81107
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \

README.md

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,46 @@ It doesn't include the Pimcore software itself, it just provides an environment
55
of Pimcore, so that you can leverage the full functionality.
66

77
You can either use this image directly by mounting Pimcore into the container, or as a template for your customized
8-
98
ready-to-deploy images. As a starting point please see [example docker-compose configuration](https://github.com/pimcore/skeleton/blob/HEAD/docker-compose.yaml).
109

11-
## Supported tags and respective Dockerfile links
12-
- PHP8.0
13-
- fpm (`pimcore/pimcore:php8.0-bullseye-fpm`)
14-
- debug (`pimcore/pimcore:php8.0-bullseye-debug`) - with xdebug enabled
15-
- supervisord (`pimcore/pimcore:php8.0-bullseye-supervisord`)
16-
- PHP8.1
17-
- fpm (`pimcore/pimcore:php8.1-bullseye-fpm`)
18-
- debug (`pimcore/pimcore:php8.1-bullseye-debug`) - with xdebug enabled
19-
- supervisord (`pimcore/pimcore:php8.1-bullseye-supervisord`)
20-
10+
## Image flavors
11+
We're providing 3 different image flavors:
12+
- PHP image for FPM and CLI (e.g. `php8.1-latest`)
13+
- PHP debug image based on PHP image above, including preconfigured Xdebug for FPM and CLI (e.g. `php8.1-debug-latest`)
14+
- Supervisord image based on PHP image above, for cron & queue processing (e.g. `php8.1-supervisord-latest`)
15+
16+
## Versioning
17+
Our images are versioned using a version-suffix staring with `-v` following SemVer.
18+
With that we're able to allow smooth upgrades, breaking changes are only delivered with major versions.
19+
Additionally we're offering 2 special tag suffixes:
20+
- `-latest` always points to the latest available tag (recommended for local development)
21+
- `-dev` always points to the work in progress
22+
23+
We're also offering special tags for specific PHP versions, e.g. `php8.1.11-v1.0`.
24+
25+
## Examples
26+
27+
### PHP images
28+
```text
29+
php8.1-latest # always use the latest PHP 8.1 image
30+
php8.1-v1 # always point to the latest minor version of v1
31+
php8.1-v1.0 # pin to specific image version, always using the latest bugfixes from PHP 8.1
32+
php8.1.11-v1.0 # pin to a specific PHP version & image version
33+
php8.1-dev # development image (build from the default branch)
34+
```
35+
36+
### PHP Debug images
37+
Same as PHP images, but using `-debug` after the PHP version:
38+
```text
39+
php8.1-debug-latest
40+
php8.1-debug-v1
41+
...
42+
```
43+
44+
### Supervisord
45+
Same as PHP images, but using `-supervisor` after the PHP version:
46+
```text
47+
php8.1-supervisor-latest
48+
php8.1-supervisor-v1
49+
...
50+
```

0 commit comments

Comments
 (0)