Skip to content

Commit e74760b

Browse files
authored
Merge pull request #421 from OpenConext/feature/build-and-publish-test-container
Add docker build test image workflow
2 parents 4eade03 + 4b35243 commit e74760b

File tree

4 files changed

+88
-3
lines changed

4 files changed

+88
-3
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: build-push-test-docker-image
2+
3+
on:
4+
push:
5+
branches:
6+
- feature/build-and-publish-test-container
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-push-test-docker-image:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
packages: write
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Build the app
19+
uses: openconext/build-and-publish-test-container/php82-node20@main
20+
with:
21+
use_yarn: true
22+
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v2
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v2
28+
29+
- name: Login to GitHub Container Registry
30+
uses: docker/login-action@v2
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.repository_owner }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Set docker labels and tags
37+
id: meta
38+
uses: docker/metadata-action@v5
39+
with:
40+
images: ghcr.io/openconext/stepup-ra/stepup-ra
41+
flavor: |
42+
latest=false
43+
suffix=-test
44+
tags: |
45+
type=ref,event=tag
46+
type=semver,pattern={{version}}
47+
type=sha
48+
type=raw,suffix=,value=test
49+
50+
- name: Build and push the TEST image
51+
uses: docker/build-push-action@v4
52+
with:
53+
context: .
54+
file: docker/Dockerfile.test
55+
platforms: linux/amd64,linux/arm64
56+
push: true
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}

component_info

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ ENCORE=yes
44
ASSETIC=no
55
NODE_VERSION=20
66
COMPOSER_VERSION=2
7+
TEST_EXTRA_DIRS="ci/"

config/packages/web_profiler.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
when@dev: &template
1+
when@dev:
22
web_profiler:
33
toolbar: true
44
intercept_redirects: false
5-
when@test: *template
6-
when@smoketest: *template
5+
6+
when@test: &testTemplate
7+
web_profiler:
8+
toolbar: false
9+
intercept_redirects: false
10+
when@smoketest: *testTemplate
711

docker/Dockerfile.test

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM busybox AS unpack
2+
WORKDIR /unpack
3+
COPY output.zip /unpack
4+
RUN unzip /unpack/output.zip
5+
6+
FROM ghcr.io/openconext/openconext-basecontainers/php82-apache2:latest
7+
# Set the default workdir
8+
WORKDIR /var/www/html
9+
COPY --from=unpack /unpack/ /var/www/html/
10+
# Add the application configuration files
11+
COPY config/openconext/parameters.yaml.dist config/openconext/parameters.yaml
12+
COPY config/openconext/samlstepupproviders_parameters.yaml.dist config/openconext/samlstepupproviders_parameters.yaml
13+
14+
# Add the config files for Apache2
15+
RUN rm -rf /etc/apache2/sites-enabled/*
16+
COPY ./docker/conf/apache2.conf /etc/apache2/sites-enabled/apache2.conf
17+
RUN rm -rf /var/www/html/var/cache/prod &&\
18+
mkdir -p /var/www/html/var/cache &&\
19+
chown -R www-data /var/www/html/var
20+
21+
EXPOSE 80
22+
CMD ["apache2-foreground"]

0 commit comments

Comments
 (0)