mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
24 lines
No EOL
1.1 KiB
Bash
24 lines
No EOL
1.1 KiB
Bash
#!/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 |