Skip to content

Commit bd0ce62

Browse files
committed
ci: pull fih-test docker image on install
Update install script to avoid building a docker image and instead pull; also add proper caching for re-runs. Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
1 parent a069bef commit bd0ce62

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ install:
7070
script:
7171
- ./ci/${TEST}_run.sh
7272

73+
cache:
74+
directories:
75+
- docker
76+
7377
notifications:
7478
slack:
7579
rooms:

ci/fih-tests_install.sh

+11-9
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616

1717
set -e
1818

19-
# get mcuboot root; assumes running script is stored under REPO_DIR/ci/
20-
REPO_DIR=$(dirname $(dirname $(realpath $0)))
21-
pushd $(mktemp -d)
19+
DOCKER_DIR=docker
2220

23-
# copy mcuboot so that it is part of the docker build context
24-
cp -r $REPO_DIR .
25-
cp -r $REPO_DIR/ci/fih_test_docker/execute_test.sh .
26-
cp -r $REPO_DIR/ci/fih_test_docker/Dockerfile .
27-
./mcuboot/ci/fih_test_docker/build.sh
28-
popd
21+
IMAGE=fih-test:0.0.1
22+
23+
CACHED_IMAGE=$DOCKER_DIR/$IMAGE
24+
25+
[[ -f $CACHED_IMAGE ]] && (gzip -dc $CACHED_IMAGE | docker load)
26+
27+
if [[ $? -ne 0 ]]; then
28+
docker pull mcuboot/$IMAGE
29+
docker save mcuboot/$IMAGE | gzip > $CACHED_IMAGE
30+
fi

0 commit comments

Comments
 (0)