Skip to content

Commit fbff72a

Browse files
committed
ci: Move the current container version to .containerversion
* Add helper `make dockerpull` to pull the current version of the container image. * `make dockerinit` now tags with the current version. The logic is that if you are working on the container image, you should bump the version in `.containerversion`. * `make dockerdev` will now default to the specific version instead of `latest`
1 parent 66b3438 commit fbff72a

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

.ci/run-container-ci

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
set -e
2626
set -x
2727

28-
CONTAINER=shiftcrypto/firmware_v2:41
28+
CONTAINER_REPO=shiftcrypto/firmware_v2
29+
CONTAINER_VERSION=$(cat .containerversion)
30+
CONTAINER=$CONTAINER_REPO:${CONTAINER_VERSION}
2931

3032
if [ "$1" == "pull" ] ; then
3133
docker pull "$CONTAINER"

.containerversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
41

BUILD.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ make dockerdev
3939
The docker container will not allow you to access the hosts USB devices by default which means that
4040
it is necessary to flash the device in a terminal not running in docker.
4141

42+
> [!NOTE]
43+
> Current development container is defined in the file `.containerversion`
44+
4245
### Install development environment on macOS
4346

4447
Make sure you have [Homebrew](https://brew.sh) installed.

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ jlink-flash-factory-setup: | build
129129
jlink-flash-firmware-semihosting: | build-semihosting
130130
JLinkExe -if SWD -device ATSAMD51J20 -speed 4000 -autoconnect 1 -CommanderScript ./build-semihosting/scripts/firmware.jlink
131131
dockerinit:
132-
./scripts/container.sh build --pull --platform linux/amd64 --force-rm --no-cache -t shiftcrypto/firmware_v2 .
132+
./scripts/container.sh build --pull --platform linux/amd64 --force-rm --no-cache -t shiftcrypto/firmware_v2:$(shell cat .containerversion) .
133+
dockerpull:
134+
./scripts/container.sh pull shiftcrypto/firmware_v2:$(shell cat .containerversion)
133135
dockerdev:
134136
./scripts/dockerenv.sh
135137
dockerrel:

scripts/dockerenv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ else
3333
fi
3434

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

0 commit comments

Comments
 (0)