Skip to content

Commit

Permalink
Test base image in local registry
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Oct 17, 2023
1 parent 6f4d397 commit 6498619
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/docker_debian_unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ jobs:
outputs:
runs_on: ubuntu-latest

# Definition of the matrix values for the subsequent jobs
matrix_debian_version: "['bullseye', 'buster']"
matrix_username: "['pi', 'hans']"
matrix_username: "['hans']" #"['pi', 'hans']"
matrix_test_script: "['run_installation_tests.sh', 'run_installation_tests2.sh', 'run_installation_tests3.sh']"

cache_scope: ${{ steps.set-cache_scope.outputs.cache_scope }}
Expand Down Expand Up @@ -59,6 +60,11 @@ jobs:
build:
needs: [prepare]
runs-on: ${{ needs.prepare.outputs.runs_on }}
services:
registry:
image: registry:2
ports:
- 5000:5000

strategy:
fail-fast: false
Expand All @@ -73,21 +79,26 @@ jobs:

- name: Set up Docker Buildx
uses: docker/[email protected]
with:
# network=host driver-opt needed to push to local registry
driver-opts: network=host

- name: Build Image ARMv7 - Base
uses: docker/build-push-action@v5
with:
context: .
load: false
push: false
push: true
file: ./ci/Dockerfile.debian.test_install_unified.armv7
target: user
target: test
platforms: linux/arm/v7
tags: ${{ format( needs.prepare.outputs.image_tag_name, matrix.debian_version) }}-base
tags: localhost:5000/${{ format( needs.prepare.outputs.image_tag_name, matrix.debian_version) }}-base
cache-from: type=gha,scope=${{ format( needs.prepare.outputs.cache_scope, matrix.debian_version) }}
cache-to: type=gha,mode=max,scope=${{ format( needs.prepare.outputs.cache_scope, matrix.debian_version) }}
build-args: |
DEBIAN_VERSION=${{ matrix.debian_version }}
GIT_BRANCH=${{ github.ref_name }}
GIT_URL=${{ github.server_url }}/${{ github.repository }}
- name: Build Image ARMv7 - Update
Expand All @@ -104,9 +115,8 @@ jobs:
# DON'T use 'cache-to' here as then the layer is cached and this build would be useless
outputs: type=docker,dest=${{ format( needs.prepare.outputs.image_file_path, matrix.debian_version) }}
build-args: |
DEBIAN_VERSION=${{ matrix.debian_version }}
GIT_BRANCH=${{ github.ref_name }}
GIT_URL=${{ github.server_url }}/${{ github.repository }}
BASE_TEST_IMAGE="localhost:5000/${{ format( needs.prepare.outputs.image_tag_name, matrix.debian_version) }}-base"
- name: Cache Check Docker Image
uses: actions/cache/restore@v3
Expand Down
3 changes: 2 additions & 1 deletion ci/Dockerfile.debian.test_install_unified.armv7
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Target to build and install all needed base configuration and packages
ARG DEBIAN_VERSION=bullseye
ARG BASE_TEST_IMAGE=test
FROM debian:${DEBIAN_VERSION}-slim as base
ARG DEBIAN_VERSION

Expand Down Expand Up @@ -70,7 +71,7 @@ COPY --chown=root:$TEST_USER_GROUP --chmod=770 scripts/installscripts/tests/*.sh


# Target for applying latest updates (should not be cached!)
FROM test as test-update
FROM $BASE_TEST_IMAGE as test-update
RUN apt-get update \
&& apt-get -y upgrade \
&& rm -rf /var/lib/apt/lists/*
Expand Down

0 comments on commit 6498619

Please sign in to comment.