Skip to content

Commit

Permalink
Merge pull request #1282 from NickeZ/nickez/create-containerversion
Browse files Browse the repository at this point in the history
ci: Move the current container version to .containerversion
  • Loading branch information
NickeZ authored Aug 20, 2024
2 parents 66b3438 + fbff72a commit 462cfde
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .ci/run-container-ci
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
set -e
set -x

CONTAINER=shiftcrypto/firmware_v2:41
CONTAINER_REPO=shiftcrypto/firmware_v2
CONTAINER_VERSION=$(cat .containerversion)
CONTAINER=$CONTAINER_REPO:${CONTAINER_VERSION}

if [ "$1" == "pull" ] ; then
docker pull "$CONTAINER"
Expand Down
1 change: 1 addition & 0 deletions .containerversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
41
3 changes: 3 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ make dockerdev
The docker container will not allow you to access the hosts USB devices by default which means that
it is necessary to flash the device in a terminal not running in docker.

> [!NOTE]
> Current development container is defined in the file `.containerversion`
### Install development environment on macOS

Make sure you have [Homebrew](https://brew.sh) installed.
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ jlink-flash-factory-setup: | build
jlink-flash-firmware-semihosting: | build-semihosting
JLinkExe -if SWD -device ATSAMD51J20 -speed 4000 -autoconnect 1 -CommanderScript ./build-semihosting/scripts/firmware.jlink
dockerinit:
./scripts/container.sh build --pull --platform linux/amd64 --force-rm --no-cache -t shiftcrypto/firmware_v2 .
./scripts/container.sh build --pull --platform linux/amd64 --force-rm --no-cache -t shiftcrypto/firmware_v2:$(shell cat .containerversion) .
dockerpull:
./scripts/container.sh pull shiftcrypto/firmware_v2:$(shell cat .containerversion)
dockerdev:
./scripts/dockerenv.sh
dockerrel:
Expand Down
2 changes: 1 addition & 1 deletion scripts/dockerenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ else
fi

CONTAINER_IMAGE=shiftcrypto/firmware_v2
CONTAINER_VERSION=${CONTAINER_VERSION:-latest}
CONTAINER_VERSION=${CONTAINER_VERSION:-$(cat .containerversion)}
PROJECT_NAME="$(basename "$(realpath "$DIR/..")")"
CONTAINER_NAME="$PROJECT_NAME-$CONTAINER_NAME_SUFFIX"

Expand Down

0 comments on commit 462cfde

Please sign in to comment.