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>
This commit is contained in:
Fabio Utzig 2020-12-14 17:14:53 -03:00 committed by Fabio Utzig
parent a069befebd
commit bd0ce62073
2 changed files with 15 additions and 9 deletions

View File

@ -70,6 +70,10 @@ install:
script:
- ./ci/${TEST}_run.sh
cache:
directories:
- docker
notifications:
slack:
rooms:

View File

@ -16,13 +16,15 @@
set -e
# get mcuboot root; assumes running script is stored under REPO_DIR/ci/
REPO_DIR=$(dirname $(dirname $(realpath $0)))
pushd $(mktemp -d)
DOCKER_DIR=docker
# copy mcuboot so that it is part of the docker build context
cp -r $REPO_DIR .
cp -r $REPO_DIR/ci/fih_test_docker/execute_test.sh .
cp -r $REPO_DIR/ci/fih_test_docker/Dockerfile .
./mcuboot/ci/fih_test_docker/build.sh
popd
IMAGE=fih-test:0.0.1
CACHED_IMAGE=$DOCKER_DIR/$IMAGE
[[ -f $CACHED_IMAGE ]] && (gzip -dc $CACHED_IMAGE | docker load)
if [[ $? -ne 0 ]]; then
docker pull mcuboot/$IMAGE
docker save mcuboot/$IMAGE | gzip > $CACHED_IMAGE
fi