Skip to content

Commit

Permalink
renamed var DEBIAN_VERSION_NAME to DEBIAN_CODENAME
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Oct 26, 2023
1 parent 60ca2da commit 6fcbaa3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test_docker_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:

# Build container and run tests
run:
name: ${{ matrix.debian_version_name }}
name: ${{ matrix.debian_codename }}
strategy:
fail-fast: false
matrix:
debian_version_name: ['bullseye', 'buster']
debian_codename: ['bullseye', 'buster']
uses: ./.github/workflows/test_docker_debian_versionname_sub.yml
with:
runs_on: ubuntu-latest
Expand All @@ -34,4 +34,4 @@ jobs:
cache_scope: ${{ github.ref }}-test-debian
matrix_usernames: "['pi', 'hans']"
matrix_test_scripts: "['run_installation_tests.sh', 'run_installation_tests2.sh', 'run_installation_tests3.sh']"
debian_version_name: ${{ matrix.debian_version_name }}
debian_codename: ${{ matrix.debian_codename }}
18 changes: 9 additions & 9 deletions .github/workflows/test_docker_debian_versionname_sub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
platform:
required: true
type: string
debian_version_name:
debian_codename:
required: true
type: string
cache_scope:
Expand All @@ -32,7 +32,7 @@ on:
# let only one instance run the test so cache is not corrupted.
# cancel already running instances as only the last run will be relevant
concurrency:
group: ${{ inputs.cache_scope }}-${{ inputs.debian_version_name }}
group: ${{ inputs.cache_scope }}-${{ inputs.debian_codename }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -68,23 +68,23 @@ jobs:
- name: Set Output pre-vars
id: pre-vars
env:
DEBIAN_VERSION_NAME: ${{ inputs.debian_version_name }}
DEBIAN_CODENAME: ${{ inputs.debian_codename }}
DOCKER_IMAGE_NAME: ${{ inputs.docker_image_name }}
CACHE_SCOPE: ${{ inputs.cache_scope }}
run: |
echo "image_tag_name=${{ env.DOCKER_IMAGE_NAME }}:${{ env.DEBIAN_VERSION_NAME }}-test" >> $GITHUB_OUTPUT
echo "cache_scope=${{ env.CACHE_SCOPE }}-${{ env.DEBIAN_VERSION_NAME }}" >> $GITHUB_OUTPUT
echo "image_tag_name=${{ env.DOCKER_IMAGE_NAME }}:${{ env.DEBIAN_CODENAME }}-test" >> $GITHUB_OUTPUT
echo "cache_scope=${{ env.CACHE_SCOPE }}-${{ env.DEBIAN_CODENAME }}" >> $GITHUB_OUTPUT
- name: Set Output vars
id: vars
env:
DEBIAN_VERSION_NAME: ${{ inputs.debian_version_name }}
DEBIAN_CODENAME: ${{ inputs.debian_codename }}
DOCKER_IMAGE_NAME: ${{ inputs.docker_image_name }}
LOCAL_REGISTRY_PORT: ${{ inputs.local_registry_port }}
run: |
echo "image_tag_name=${{ steps.pre-vars.outputs.image_tag_name }}" >> $GITHUB_OUTPUT
echo "image_tag_name_local_base=localhost:${{ env.LOCAL_REGISTRY_PORT }}/${{ steps.pre-vars.outputs.image_tag_name }}-base" >> $GITHUB_OUTPUT
echo "image_file_path=./${{ env.DOCKER_IMAGE_NAME }}-${{ env.DEBIAN_VERSION_NAME }}.tar" >> $GITHUB_OUTPUT
echo "image_file_path=./${{ env.DOCKER_IMAGE_NAME }}-${{ env.DEBIAN_CODENAME }}.tar" >> $GITHUB_OUTPUT
echo "cache_scope=${{ steps.pre-vars.outputs.cache_scope }}" >> $GITHUB_OUTPUT
echo "cache_key=${{ steps.pre-vars.outputs.cache_scope }}-${{ github.sha }}#${{ github.run_attempt }}" >> $GITHUB_OUTPUT
Expand All @@ -102,7 +102,7 @@ jobs:
cache-from: type=gha,scope=${{ steps.vars.outputs.cache_scope }}
cache-to: type=gha,mode=max,scope=${{ steps.vars.outputs.cache_scope }}
build-args: |
DEBIAN_VERSION_NAME=${{ inputs.debian_version_name }}
DEBIAN_CODENAME=${{ inputs.debian_codename }}
GIT_BRANCH=${{ github.head_ref || github.ref_name }}
GIT_URL=${{ github.server_url }}/${{ github.event.pull_request.head.repo.full_name || github.repository }}
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
docker load --input ${{ needs.build.outputs.image_file_path }}
# Run test
- name: Run Test ${{ inputs.debian_version_name }}-${{ matrix.username }}-${{ matrix.test_script }}
- name: Run Test ${{ inputs.debian_codename }}-${{ matrix.username }}-${{ matrix.test_script }}
uses: tj-actions/docker-run@v2
with:
image: ${{ needs.build.outputs.image_tag_name }}
Expand Down
10 changes: 5 additions & 5 deletions ci/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Base Target to build and install all needed base configuration and packages. Specifie the needed platform with the docker '--platform XXX' option
ARG DEBIAN_VERSION_NAME=bullseye
ARG DEBIAN_CODENAME=bullseye
ARG BASE_TEST_IMAGE=test-code
FROM debian:${DEBIAN_VERSION_NAME}-slim as base
ARG DEBIAN_VERSION_NAME
FROM debian:${DEBIAN_CODENAME}-slim as base
ARG DEBIAN_CODENAME

ENV DOCKER_RUNNING=true
RUN touch /boot/cmdlinetxt
Expand All @@ -15,8 +15,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \
gnupg \
&& curl -fsSL http://raspbian.raspberrypi.org/raspbian.public.key | gpg --dearmor > /usr/share/keyrings/raspberrypi-raspbian-keyring.gpg \
&& curl -fsSL http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | gpg --dearmor > /usr/share/keyrings/raspberrypi-archive-debian-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/raspberrypi-raspbian-keyring.gpg] http://raspbian.raspberrypi.org/raspbian/ ${DEBIAN_VERSION_NAME} main contrib non-free rpi" > /etc/apt/sources.list.d/raspi.list \
&& echo "deb [signed-by=/usr/share/keyrings/raspberrypi-archive-debian-keyring.gpg] http://archive.raspberrypi.org/debian/ ${DEBIAN_VERSION_NAME} main" >> /etc/apt/sources.list.d/raspi.list \
&& echo "deb [signed-by=/usr/share/keyrings/raspberrypi-raspbian-keyring.gpg] http://raspbian.raspberrypi.org/raspbian/ ${DEBIAN_CODENAME} main contrib non-free rpi" > /etc/apt/sources.list.d/raspi.list \
&& echo "deb [signed-by=/usr/share/keyrings/raspberrypi-archive-debian-keyring.gpg] http://archive.raspberrypi.org/debian/ ${DEBIAN_CODENAME} main" >> /etc/apt/sources.list.d/raspi.list \
&& apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install \
Expand Down
2 changes: 1 addition & 1 deletion ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This is a work in progress so expect things to fail or being flaky.
* for builds
- on normal PCs use `--platform=linux/amd64`
- on a raspberry pi use `--platform=linux/arm/v7`
* to use a different debian version as base add parameter `--build-arg="DEBIAN_VERSION_NAME=<code_name>"` (<code_name> = e.g. buster, bullseye, ...).
* to use a different debian version as base add parameter `--build-arg="DEBIAN_CODENAME=<code_name>"` (<code_name> = e.g. buster, bullseye, ...).

* get something to drink or eat
* run the freshly built docker image and start testing. For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ JUKEBOX_HOME_DIR="${HOME_DIR}/RPi-Jukebox-RFID"
LOGDIR="${HOME_DIR}"/phoniebox_logs
JUKEBOX_BACKUP_DIR="${HOME_DIR}/BACKUP"

# Get the RaspberryPi OS code name (e.g. buster, bullseye, ...)
# Get the RaspberryPi OS codename (e.g. buster, bullseye, ...)
OS_CODENAME="$( . /etc/os-release; printf '%s\n' "$VERSION_CODENAME"; )"
printf "Used RaspberryPi OS: ${OS_CODENAME}\n"

Expand Down
2 changes: 1 addition & 1 deletion scripts/installscripts/buster-install-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ JUKEBOX_HOME_DIR="${HOME_DIR}/RPi-Jukebox-RFID"
LOGDIR="${HOME_DIR}"/phoniebox_logs
JUKEBOX_BACKUP_DIR="${HOME_DIR}/BACKUP"

# Get the RaspberryPi OS code name (e.g. buster, bullseye, ...)
# Get the RaspberryPi OS codename (e.g. buster, bullseye, ...)
OS_CODENAME="$( . /etc/os-release; printf '%s\n' "$VERSION_CODENAME"; )"
printf "Used RaspberryPi OS: ${OS_CODENAME}\n"

Expand Down

0 comments on commit 6fcbaa3

Please sign in to comment.