[travis] Cache docker imgs (#3523)

* [travis] Cache build img

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>

* [travis] Safely cache imgs

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
pull/3526/head
Daniel Van Der Maden 4 years ago committed by GitHub
parent 0c6dd80862
commit 0b6a90a28c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .travis.yml
  2. 6
      scripts/travis_rosetta_checker.sh
  3. 6
      scripts/travis_rpc_checker.sh

@ -4,6 +4,9 @@ language: go
go: go:
- 1.14 - 1.14
go_import_path: github.com/harmony-one/harmony go_import_path: github.com/harmony-one/harmony
cache:
directories:
- docker_images
env: env:
- TEST="make" - TEST="make"
- TEST="bash ./scripts/travis_go_checker.sh" - TEST="bash ./scripts/travis_go_checker.sh"

@ -1,5 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
CACHE_DIR="docker_images"
mkdir -p $CACHE_DIR
echo "pulling cached docker img"
docker load -i $CACHE_DIR/images.tar || true
docker pull harmonyone/localnet-test docker pull harmonyone/localnet-test
echo "saving cached docker img"
docker save -o $CACHE_DIR/images.tar harmonyone/localnet-test
docker run -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -r docker run -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -r

@ -1,5 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
CACHE_DIR="docker_images"
mkdir -p $CACHE_DIR
echo "pulling cached docker img"
docker load -i $CACHE_DIR/images.tar || true
docker pull harmonyone/localnet-test docker pull harmonyone/localnet-test
echo "saving cached docker img"
docker save -o $CACHE_DIR/images.tar harmonyone/localnet-test
docker run -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -n docker run -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -n
Loading…
Cancel
Save