Commit bd0ce620 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

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: default avatarFabio Utzig <fabio.utzig@nordicsemi.no>
parent a069befe
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -70,6 +70,10 @@ install:
script:
  - ./ci/${TEST}_run.sh

cache:
  directories:
  - docker

notifications:
  slack:
    rooms:
+11 −9
Original line number Diff line number Diff line
@@ -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
 No newline at end of file
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