Skip to content

Commit 0bf9876

Browse files
authored
Merge pull request #421 from roundcube/Fix-building-1.7-and-1.6
Fix building images for 1.7.x and 1.6.x
2 parents eebfa81 + a846d27 commit 0bf9876

4 files changed

Lines changed: 274 additions & 15 deletions

File tree

.github/workflows/build-1.6.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
name: Build & Publish
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- 'master'
10+
paths:
11+
- 'apache-1.6.x/**'
12+
- 'fpm-1.6.x/**'
13+
- 'fpm-alpine-1.6.x/**'
14+
- '.github/workflows/*-1.6.yml'
15+
tags:
16+
- '1.6.*'
17+
schedule:
18+
# Rebuild images each monday early morning to ensure a fresh base OS.
19+
- cron: "23 2 * * 1"
20+
workflow_dispatch:
21+
22+
jobs:
23+
build-and-testvariants:
24+
name: Build image variants and run tests
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
max-parallel: 10
29+
matrix:
30+
include:
31+
# The tags are pretty repetetive, but we can't properly script things using GitHub actions, and want to avoid scripting all the things manually, so we live with it.
32+
- variant: 'apache'
33+
test-files: 'apache-postgres'
34+
docker-tag: |
35+
roundcube/roundcubemail:1.6.x-apache
36+
roundcube/roundcubemail:1.6.15-apache
37+
roundcube/roundcubemail:latest-apache
38+
roundcube/roundcubemail:latest
39+
docker-tag-nonroot: |
40+
roundcube/roundcubemail:1.6.x-apache-nonroot
41+
roundcube/roundcubemail:1.6.15-apache-nonroot
42+
roundcube/roundcubemail:latest-apache-nonroot
43+
roundcube/roundcubemail:latest-nonroot
44+
test-tag: roundcube/roundcubemail:latest-apache
45+
test-tag-nonroot: roundcube/roundcubemail:latest-apache-nonroot
46+
http-port-nonroot: '8000'
47+
- variant: 'fpm'
48+
test-files: 'fpm-postgres'
49+
docker-tag: |
50+
roundcube/roundcubemail:1.6.x-fpm
51+
roundcube/roundcubemail:1.6.15-fpm
52+
roundcube/roundcubemail:latest-fpm
53+
docker-tag-nonroot: |
54+
roundcube/roundcubemail:1.6.x-fpm-nonroot
55+
roundcube/roundcubemail:1.6.15-fpm-nonroot
56+
roundcube/roundcubemail:latest-fpm-nonroot
57+
test-tag: roundcube/roundcubemail:latest-fpm
58+
test-tag-nonroot: roundcube/roundcubemail:latest-fpm-nonroot
59+
- variant: 'fpm-alpine'
60+
test-files: 'fpm-postgres'
61+
docker-tag: |
62+
roundcube/roundcubemail:1.6.x-fpm-alpine
63+
roundcube/roundcubemail:1.6.15-fpm-alpine
64+
roundcube/roundcubemail:latest-fpm-alpine
65+
docker-tag-nonroot: |
66+
roundcube/roundcubemail:1.6.x-fpm-alpine-nonroot
67+
roundcube/roundcubemail:1.6.15-fpm-alpine-nonroot
68+
roundcube/roundcubemail:latest-fpm-alpine-nonroot
69+
test-tag: roundcube/roundcubemail:latest-fpm-alpine
70+
test-tag-nonroot: roundcube/roundcubemail:latest-fpm-alpine-nonroot
71+
target: 'root'
72+
steps:
73+
- name: Checkout repository
74+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
75+
- name: Set up Docker
76+
# This step is required to enable the containerd image store, which is required by the cache type=gha
77+
uses: docker/setup-docker-action@efe9e3891a4f7307e689f2100b33a155b900a608 # v4.5.0
78+
with:
79+
daemon-config: |
80+
{
81+
"debug": true,
82+
"features": {
83+
"containerd-snapshotter": true
84+
}
85+
}
86+
- name: Set up QEMU
87+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
88+
- name: Set up Docker Buildx
89+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
90+
with:
91+
buildkitd-flags: --debug
92+
93+
- name: Build rootful image to test for "${{ matrix.variant }}"
94+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
95+
with:
96+
context: ${{ matrix.variant }}
97+
load: true
98+
tags: ${{ matrix.docker-tag }}
99+
target: root
100+
cache-from: type=gha
101+
cache-to: type=gha,mode=max
102+
103+
- name: Test rootful image for "${{ matrix.variant }}"
104+
env:
105+
ROUNDCUBEMAIL_TEST_IMAGE: ${{ matrix.test-tag }}
106+
HTTP_PORT: '80'
107+
run: |
108+
set -exu;
109+
for testFile in ${{ join(matrix.test-files, ' ') }};
110+
do
111+
docker compose -f ./tests/docker-compose.test-${testFile}.yml down -v
112+
docker compose -f ./tests/docker-compose.test-${testFile}.yml up --exit-code-from=sut --abort-on-container-exit
113+
done
114+
115+
# Only log into docker now, so we benefit from the automatic caching of upstream images.
116+
- name: Get docker hub username
117+
id: creds
118+
run: echo 'username=${{ secrets.DOCKER_PULL_USERNAME }}' >> $GITHUB_OUTPUT
119+
- name: Login to Docker Hub
120+
if: steps.creds.outputs.username != ''
121+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
122+
with:
123+
username: ${{ secrets.DOCKER_PULL_USERNAME }}
124+
password: ${{ secrets.DOCKER_PUSH_PASSWORD }}
125+
126+
- name: Build and push rootful images for "${{ matrix.variant }} for all platforms"
127+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
128+
with:
129+
context: ${{ matrix.variant }}
130+
platforms: "linux/arm64,linux/arm/v6,linux/arm/v7,linux/386,linux/amd64,"
131+
push: true
132+
tags: ${{ matrix.docker-tag }}
133+
target: root
134+
cache-from: type=gha
135+
cache-to: type=gha,mode=max
136+
137+
- name: Build nonroot image to test for "${{ matrix.variant }}"
138+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
139+
with:
140+
context: ${{ matrix.variant }}
141+
load: true
142+
tags: ${{ matrix.docker-tag-nonroot }}
143+
target: nonroot
144+
cache-from: type=gha
145+
cache-to: type=gha,mode=max
146+
147+
- name: Test nonroot image for "${{ matrix.variant }}"
148+
env:
149+
ROUNDCUBEMAIL_TEST_IMAGE: ${{ matrix.test-tag-nonroot }}
150+
HTTP_PORT: ${{ matrix.http-port-nonroot || '80' }}
151+
run: |
152+
set -exu;
153+
for testFile in ${{ join(matrix.test-files, ' ') }};
154+
do
155+
docker compose -f ./tests/docker-compose.test-${testFile}.yml down -v
156+
docker compose -f ./tests/docker-compose.test-${testFile}.yml up --exit-code-from=sut --abort-on-container-exit
157+
done
158+
159+
- name: Build and push nonroot images for "${{ matrix.variant }} for all platforms"
160+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
161+
with:
162+
context: ${{ matrix.variant }}
163+
platforms: "linux/arm64,linux/arm/v6,linux/arm/v7,linux/386,linux/amd64,"
164+
push: true
165+
tags: ${{ matrix.docker-tag-nonroot }}
166+
target: nonroot
167+
cache-from: type=gha
168+
cache-to: type=gha,mode=max

.github/workflows/build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ on:
1010
paths-ignore:
1111
- 'README.md'
1212
- 'examples/**'
13-
- 'apache-1.5.x/**'
14-
- 'fpm-1.5.x/**'
15-
- 'fpm-alpine-1.5.x/**'
16-
- '.github/workflows/*-1.5.yml'
13+
- 'apache-1.6.x/**'
14+
- 'fpm-1.6.x/**'
15+
- 'fpm-alpine-1.6.x/**'
16+
- '.github/workflows/*-1.6.yml'
1717
- 'development/**'
1818
- 'nightly/**'
1919
tags:
20-
- '1.6.*'
20+
- '1.7.*'
2121
schedule:
2222
# Rebuild images each monday early morning to ensure a fresh base OS.
2323
- cron: "23 2 * * 1"
@@ -36,12 +36,12 @@ jobs:
3636
- variant: 'apache'
3737
test-files: 'apache-postgres'
3838
docker-tag: |
39-
roundcube/roundcubemail:1.6.x-apache
39+
roundcube/roundcubemail:1.7.x-apache
4040
roundcube/roundcubemail:1.7.0-apache
4141
roundcube/roundcubemail:latest-apache
4242
roundcube/roundcubemail:latest
4343
docker-tag-nonroot: |
44-
roundcube/roundcubemail:1.6.x-apache-nonroot
44+
roundcube/roundcubemail:1.7.x-apache-nonroot
4545
roundcube/roundcubemail:1.7.0-apache-nonroot
4646
roundcube/roundcubemail:latest-apache-nonroot
4747
roundcube/roundcubemail:latest-nonroot
@@ -51,23 +51,23 @@ jobs:
5151
- variant: 'fpm'
5252
test-files: 'fpm-postgres'
5353
docker-tag: |
54-
roundcube/roundcubemail:1.6.x-fpm
54+
roundcube/roundcubemail:1.7.x-fpm
5555
roundcube/roundcubemail:1.7.0-fpm
5656
roundcube/roundcubemail:latest-fpm
5757
docker-tag-nonroot: |
58-
roundcube/roundcubemail:1.6.x-fpm-nonroot
58+
roundcube/roundcubemail:1.7.x-fpm-nonroot
5959
roundcube/roundcubemail:1.7.0-fpm-nonroot
6060
roundcube/roundcubemail:latest-fpm-nonroot
6161
test-tag: roundcube/roundcubemail:latest-fpm
6262
test-tag-nonroot: roundcube/roundcubemail:latest-fpm-nonroot
6363
- variant: 'fpm-alpine'
6464
test-files: 'fpm-postgres'
6565
docker-tag: |
66-
roundcube/roundcubemail:1.6.x-fpm-alpine
66+
roundcube/roundcubemail:1.7.x-fpm-alpine
6767
roundcube/roundcubemail:1.7.0-fpm-alpine
6868
roundcube/roundcubemail:latest-fpm-alpine
6969
docker-tag-nonroot: |
70-
roundcube/roundcubemail:1.6.x-fpm-alpine-nonroot
70+
roundcube/roundcubemail:1.7.x-fpm-alpine-nonroot
7171
roundcube/roundcubemail:1.7.0-fpm-alpine-nonroot
7272
roundcube/roundcubemail:latest-fpm-alpine-nonroot
7373
test-tag: roundcube/roundcubemail:latest-fpm-alpine

.github/workflows/test-1.6.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Build & Test
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- apache-1.6.x/**
10+
- fpm-1.6.x/**
11+
- fpm-alpine-1.6.x/**
12+
- .github/workflows/*-1.6.yml
13+
14+
jobs:
15+
build-and-testvariants:
16+
name: Build image variants and run tests
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
max-parallel: 10
21+
matrix:
22+
include:
23+
- variant: 'apache'
24+
test-files: 'apache-postgres'
25+
docker-tag: roundcube/roundcubemail:test-apache
26+
docker-tag-nonroot: roundcube/roundcubemail:test-apache-nonroot
27+
http-port-nonroot: '8000'
28+
- variant: 'fpm'
29+
test-files: 'fpm-postgres'
30+
docker-tag: roundcube/roundcubemail:test-fpm
31+
docker-tag-nonroot: roundcube/roundcubemail:test-fpm-nonroot
32+
- variant: 'fpm-alpine'
33+
test-files: 'fpm-postgres'
34+
docker-tag: roundcube/roundcubemail:test-fpm-alpine
35+
docker-tag-nonroot: roundcube/roundcubemail:test-fpm-alpine-nonroot
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39+
- name: Set up Docker
40+
# This step is required to enable the containerd image store, which is required by the cache type=gha
41+
uses: docker/setup-docker-action@efe9e3891a4f7307e689f2100b33a155b900a608 # v4.5.0
42+
with:
43+
daemon-config: |
44+
{
45+
"debug": true,
46+
"features": {
47+
"containerd-snapshotter": true
48+
}
49+
}
50+
51+
- name: Build rootful image for "${{ matrix.variant }}"
52+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
53+
with:
54+
context: ${{ matrix.variant }}
55+
load: true
56+
tags: ${{ matrix.docker-tag }}
57+
target: root
58+
cache-from: type=gha
59+
cache-to: type=gha,mode=max
60+
- name: Test rootful image
61+
env:
62+
ROUNDCUBEMAIL_TEST_IMAGE: ${{ matrix.docker-tag }}
63+
HTTP_PORT: '80'
64+
run: |
65+
set -exu;
66+
for testFile in ${{ join(matrix.test-files, ' ') }};
67+
do
68+
docker compose -f ./tests/docker-compose.test-${testFile}.yml down -v
69+
docker compose -f ./tests/docker-compose.test-${testFile}.yml up --exit-code-from=sut --abort-on-container-exit
70+
done
71+
72+
- name: Build nonroot image for "${{ matrix.variant }}"
73+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
74+
with:
75+
context: ${{ matrix.variant }}
76+
load: true
77+
tags: ${{ matrix.docker-tag-nonroot }}
78+
target: nonroot
79+
cache-from: type=gha
80+
cache-to: type=gha,mode=max
81+
- name: Test nonroot image
82+
env:
83+
ROUNDCUBEMAIL_TEST_IMAGE: ${{ matrix.docker-tag-nonroot }}
84+
HTTP_PORT: ${{ matrix.http-port-nonroot || '80' }}
85+
run: |
86+
set -exu;
87+
for testFile in ${{ join(matrix.test-files, ' ') }};
88+
do
89+
docker compose -f ./tests/docker-compose.test-${testFile}.yml down -v
90+
docker compose -f ./tests/docker-compose.test-${testFile}.yml up --exit-code-from=sut --abort-on-container-exit
91+
done

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ on:
1111
- "nightly/**"
1212
- "examples/**"
1313
- "README.md"
14-
- apache-1.5.x/**
15-
- fpm-1.5.x/**
16-
- fpm-alpine-1.5.x/**
17-
- .github/workflows/*-1.5.yml
14+
- apache-1.6.x/**
15+
- fpm-1.6.x/**
16+
- fpm-alpine-1.6.x/**
17+
- .github/workflows/*-1.6.yml
1818

1919
jobs:
2020
build-and-testvariants:

0 commit comments

Comments
 (0)