archive go/bin content and push it as cache

fix cache source
This commit is contained in:
Saw-jan
2023-03-02 12:06:37 +05:45
committed by Michael Barz
parent 4a1c873312
commit ff7118ebfd
2 changed files with 24 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
#
# $1 - root path where .bingo resides
# $2 - name of the cache item
#
ROOT_PATH="$1"
@@ -13,7 +14,7 @@ BINGO_DIR="$ROOT_PATH/.bingo"
# generate hash of a .bingo folder
BINGO_HASH=$(cat "$BINGO_DIR"/* | sha256sum | cut -d ' ' -f 1)
URL="$CACHE_ENDPOINT/$CACHE_BUCKET/ocis/go-bin/$BINGO_HASH/bin/golangci-lint"
URL="$CACHE_ENDPOINT/$CACHE_BUCKET/ocis/go-bin/$BINGO_HASH/$2"
if curl --output /dev/null --silent --head --fail "$URL"; then
echo "[INFO] Go bin cache with has '$BINGO_HASH' exists."
# https://discourse.drone.io/t/how-to-exit-a-pipeline-early-without-failing/3951