Skip to content

Commit 191fe32

Browse files
authored
Build own docker images for integration tests (#901)
* Build own docker images and upload to ghcr * update md5 sum for dockerfiles * minor text updates * Remove outdated lines from Dockerfile_arch * generate the list of dockerfiles dynamically * update wheezy checksum * fix line endings * disable automatic builds * bump httpd version for rockylinux
1 parent 5cdd0f9 commit 191fe32

File tree

8 files changed

+89
-8
lines changed

8 files changed

+89
-8
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Docker images for integration tests
2+
3+
on:
4+
# push:
5+
# branches:
6+
# - master
7+
workflow_dispatch:
8+
9+
env:
10+
PLATFORMS: "linux/amd64"
11+
12+
jobs:
13+
list-dockerfiles:
14+
name: Create list of existing dockerfiles
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Get file list
20+
id: set-matrix
21+
run: |
22+
# lists all Dockerfile_* and ignore (grep) files with extension (e.g. *.md5)
23+
# tranforms the file list in JSON array (StackOverflow#10234327)
24+
# converts the list into objects of dockerfile and image name
25+
ls integration-tests/Dockerfile_* |
26+
grep -Ev "\..{0,3}$" |
27+
jq -R -s 'split("\n")[:-1]' |
28+
jq '. | map({dockerfile: ., image: sub(".*_"; "")})' > filelist.json
29+
echo "matrix=$(jq -c . filelist.json)" >> "$GITHUB_OUTPUT"
30+
outputs:
31+
matrix: ${{ steps.set-matrix.outputs.matrix }}
32+
33+
docker:
34+
needs: [list-dockerfiles]
35+
name: Build and push Docker image
36+
runs-on: ubuntu-latest
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
include: ${{ fromJson(needs.list-dockerfiles.outputs.matrix) }}
41+
permissions:
42+
packages: write
43+
contents: read
44+
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Set up QEMU
52+
uses: docker/setup-qemu-action@v3
53+
54+
- name: Set up Docker Buildx
55+
uses: docker/setup-buildx-action@v3
56+
57+
- name: Login to GHCR
58+
uses: docker/login-action@v3
59+
with:
60+
registry: ghcr.io
61+
username: ${{ github.repository_owner }}
62+
password: ${{ secrets.GITHUB_TOKEN }}
63+
64+
- name: Extract metadata (tags, labels) for Docker
65+
id: meta
66+
uses: docker/metadata-action@v5
67+
with:
68+
images: |
69+
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}
70+
71+
- name: Build and push tag
72+
uses: docker/build-push-action@v5
73+
with:
74+
context: .
75+
file: ${{ matrix.dockerfile }}
76+
push: true
77+
tags: |
78+
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:latest
79+
labels: ${{ steps.meta.outputs.labels }}
80+
platforms: ${{ env.PLATFORMS }}

integration-tests/Dockerfile_arch

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
FROM base/archlinux
1+
FROM archlinux:base
22
MAINTAINER @siddharthist
33

4-
RUN pacman -Sy --noconfirm systemd-sysvcompat
54
RUN ln -s /does_not_exist /foo && \
65
chmod 700 ~root
76
RUN mkfifo /pipe
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7743af2cd089e92858eca1715db25949 Dockerfile_arch
1+
8fc3ce0c000f89ab09488cccb3ba8e66 Dockerfile_arch

integration-tests/Dockerfile_wheezy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ LABEL org.opencontainers.image.authors="Ahmed"
44
RUN echo 'deb http://archive.debian.org/debian wheezy main' > /etc/apt/sources.list
55
RUN echo 'deb http://archive.debian.org/debian-security wheezy/updates main' >> /etc/apt/sources.list
66

7-
RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y apache2 apache2-doc apache2-utils chkconfig vim-tiny ca-certificates tinyproxy && apt-get remove -y vim-tiny && apt-get clean
7+
RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install --yes --force-yes \
8+
apache2 apache2-doc apache2-utils chkconfig vim-tiny ca-certificates tinyproxy && \
9+
apt-get remove -y vim-tiny && apt-get clean
810

911
RUN chkconfig apache2 on
1012
RUN chkconfig tinyproxy on
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
557a19e04e66f0a9afb6035952b5ca18 Dockerfile_wheezy
1+
3775dbcd23497095da8f5b7ddb62a540 Dockerfile_wheezy

integration-tests/goss/rockylinux9/goss-aa-expected.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package:
22
httpd:
33
installed: true
44
versions:
5-
- 2.4.57-11.el9_4
5+
- 2.4.57-11.el9_4.1
66
port:
77
tcp:80:
88
listening: true

integration-tests/goss/rockylinux9/goss-expected.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ package:
1515
httpd:
1616
installed: true
1717
versions:
18-
- 2.4.57-11.el9_4
18+
- 2.4.57-11.el9_4.1
1919
vim-tiny:
2020
installed: false
2121
addr:

integration-tests/goss/vars.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ centos7:
1616
rockylinux9:
1717
proxy: http://127.0.0.1:8888
1818
packages:
19-
httpd: "2.4.57-11.el9_4"
19+
httpd: "2.4.57-11.el9_4.1"
2020
services:
2121
httpd: []
2222
trusty:

0 commit comments

Comments
 (0)