1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00
kube-arangodb/scripts/cache.sh

24 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
ROOT=$1
SHA_CODE=$(
find "${ROOT}/" \
'(' -type f -name '*.go' -not -path "${ROOT}/vendor/*" -not -path "${ROOT}/.gobuild/*" -not -path "${ROOT}/deps/*" -exec sha256sum {} \; ')' -o \
'(' -type f -name 'go.sum' -not -path "${ROOT}/vendor/*" -not -path "${ROOT}/.gobuild/*" -not -path "${ROOT}/deps/*" -exec sha256sum {} \; ')' -o \
'(' -type f -name 'go.mod' -not -path "${ROOT}/vendor/*" -not -path "${ROOT}/.gobuild/*" -not -path "${ROOT}/deps/*" -exec sha256sum {} \; ')' \
| cut -d ' ' -f1 | sha256sum | cut -d ' ' -f1
)
SHA_MOD=$(
find "${ROOT}/" \
'(' -type f -name 'go.sum' -not -path "${ROOT}/vendor/*" -not -path "${ROOT}/.gobuild/*" -not -path "${ROOT}/deps/*" -exec sha256sum {} \; ')' -o \
'(' -type f -name 'go.mod' -not -path "${ROOT}/vendor/*" -not -path "${ROOT}/.gobuild/*" -not -path "${ROOT}/deps/*" -exec sha256sum {} \; ')' \
| cut -d ' ' -f1 | sha256sum | cut -d ' ' -f1
)
echo "Checksum Code: ${SHA_CODE}"
echo "Checksum Mod: ${SHA_MOD}"
echo -n "${SHA_CODE}" > ${ROOT}/.checksum.code
echo -n "${SHA_MOD}" > ${ROOT}/.checksum.mod