From 8eb905f2a47bab68587db5a0df424ebfa2342e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Thu, 26 Mar 2020 18:44:11 +0000 Subject: [PATCH] fix(ci): nuke node_modules on failed install Travis cache gets corrupted from time to time, try to work around that by nuking node_modules when npm install fails --- .travis.yml | 3 ++- Makefile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 37c942f36..7f59d1ed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ __defaults_go: &DEFAULTS_GO go: "1.14.1" cache: directories: + - ui/node_modules # https://restic.net/blog/2018-09-02/travis-build-cache - $HOME/.cache/go-build - $HOME/gopath/pkg/mod @@ -160,7 +161,7 @@ jobs: - travis_retry nvm install $(< .nvmrc) script: - export SOURCE_DATE_EPOCH=$(git show -s --format=%ci ${TRAVIS_TAG:-${TRAVIS_COMMIT}}^{commit}) - - make crosscompile -j 2 + - travis_retry make crosscompile -j 2 - for i in karma-*; do tar --mtime="${SOURCE_DATE_EPOCH}" --owner=0 --group=0 --numeric-owner -c $i | gzip -n - > $i.tar.gz; done - shasum -a 512 karma-*.tar.gz | tee sha512sum.txt # verify that there are no uncommited changes diff --git a/Makefile b/Makefile index 0fb6b2f5a..9283526bd 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ endif .build/deps-build-node.ok: ui/package.json ui/package-lock.json @mkdir -p .build - cd ui && npm install + cd ui && (npm install || (rm -fr $@ node_modules && npm install)) touch $@ .build/artifacts-bindata_assetfs.%: