rename "name" var

This commit is contained in:
tooomm 2026-07-03 17:19:44 +02:00
parent d90d01fb9a
commit ba6ae0999b
2 changed files with 8 additions and 8 deletions

View file

@ -7,13 +7,13 @@
# usage: source <script> <name> [--get] [--build] [--save] [--interactive] [--set-cache <location>] # usage: source <script> <name> [--get] [--build] [--save] [--interactive] [--set-cache <location>]
# <name> sets the name of the docker image, these correspond to directories in .ci # <name> sets the name of the docker image, these correspond to directories in .ci
# --get loads the image from a previously saved image cache, will build if no image is found # --get loads the image from a previously saved image cache, will build if no image is found
# --build builds the image from the Dockerfile in .ci/$NAME # --build builds the image from the Dockerfile in .ci/$BUILD_REFERENCE
# --save stores the image, if an image was loaded it will not be stored # --save stores the image, if an image was loaded it will not be stored
# --interactive immediately starts the image interactively for debugging # --interactive immediately starts the image interactively for debugging
# --set-cache <location> sets the location to cache the image or for ccache # --set-cache <location> sets the location to cache the image or for ccache
# #
# requires: docker # requires: docker
# uses env: NAME CACHE BUILD GET SAVE INTERACTIVE # uses env: BUILD_REFERENCE CACHE BUILD GET SAVE INTERACTIVE
# (correspond to args: <name> --set-cache <cache> --build --get --save --interactive) # (correspond to args: <name> --set-cache <cache> --build --get --save --interactive)
# sets env: RUN CCACHE_DIR IMAGE_NAME RUN_ARGS RUN_OPTS BUILD_SCRIPT # sets env: RUN CCACHE_DIR IMAGE_NAME RUN_ARGS RUN_OPTS BUILD_SCRIPT
# exitcode: 1 for failure, 2 for missing dockerfile, 3 for invalid arguments # exitcode: 1 for failure, 2 for missing dockerfile, 3 for invalid arguments
@ -69,21 +69,21 @@ while [[ $# != 0 ]]; do
echo "unrecognized option: $1" echo "unrecognized option: $1"
return 3 return 3
fi fi
NAME="$1" BUILD_REFERENCE="$1"
shift shift
;; ;;
esac esac
done done
# Setup # Setup
if ! [[ $NAME ]]; then if ! [[ $BUILD_REFERENCE ]]; then
echo "no build name given" >&2 echo "no build name given" >&2
return 3 return 3
fi fi
export IMAGE_NAME="${project_name,,}_${NAME,,}" # lower case export IMAGE_NAME="${project_name,,}_${BUILD_REFERENCE,,}" # lower case
docker_dir=".ci/$NAME" docker_dir=".ci/$BUILD_REFERENCE"
if ! [[ -r $docker_dir/Dockerfile ]]; then if ! [[ -r $docker_dir/Dockerfile ]]; then
echo "could not find Dockerfile in $docker_dir" >&2 echo "could not find Dockerfile in $docker_dir" >&2
return 2 # even if the image is cached, we do not want to run if there is no way to build this image return 2 # even if the image is cached, we do not want to run if there is no way to build this image

View file

@ -97,7 +97,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
# The files in ".ci/$distro$distro_version" correspond to the values given here # The files in ".ci/$BUILD_REFERENCE" correspond to the values given here
include: include:
- distro: Arch - distro: Arch
@ -153,7 +153,7 @@ jobs:
CCACHE_EVICTION_AGE: 7d CCACHE_EVICTION_AGE: 7d
CCACHE_SIZE: 550M # space of all repo is 10Gi: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy CCACHE_SIZE: 550M # space of all repo is 10Gi: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
NAME: ${{ matrix.distro }}${{ matrix.distro_version }} BUILD_REFERENCE: ${{ matrix.distro }}${{ matrix.distro_version }}
steps: steps:
- name: "Checkout" - name: "Checkout"