Skip to content

Commit d048a08

Browse files
committed
Pin the bindgen docker image version
Use the commit ID as the docker version to avoid accidental fallback to 'latest' from docker hub.
1 parent a344255 commit d048a08

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ script:
1010
docker-compose run --rm $TEST_ENV scripts/clangfmt --test;
1111
fi
1212
- if [[ "$TEST_ENV" = *llvm-6.0 ]]; then
13+
export VERSION="${TRAVIS_COMMIT}";
1314
docker-compose build bindgen;
1415
find . -name target | xargs sudo rm -rf;
1516
scripts/docker-test.sh;

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3'
22

33
services:
44
bindgen:
5-
image: scalabindgen/scala-native-bindgen
5+
image: scalabindgen/scala-native-bindgen:${VERSION:-latest}
66
build:
77
context: bindgen
88
args:

scripts/docker-bindgen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ if [[ "$#" -gt 1 ]] && [[ "$1" == /* ]]; then
1414
volumes+="--volume=$1:$1"
1515
fi
1616

17-
exec docker run --rm "${volumes[@]}" scalabindgen/scala-native-bindgen "$@"
17+
exec docker run --rm "${volumes[@]}" "scalabindgen/scala-native-bindgen:${VERSION:-latest}" "$@"

scripts/docker-test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ outdir="tests/target/docker-samples"
1414
rm -rf "$outdir"
1515
mkdir -p "$outdir"
1616

17+
echo "Using version '${VERSION:-latest}'"
18+
1719
for input in tests/samples/*.h; do
1820
name="$(basename "$input" .h)"
1921
output="$outdir/$name.scala"

0 commit comments

Comments
 (0)