latest
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-12-06 02:59:08 +04:00
parent a9f23c79d2
commit ec3e7c23eb
20 changed files with 327 additions and 170 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash
set -euxo pipefail
GOI="golang:1.19.3-bullseye"
CII="golangci/golangci-lint:v1.50.1"
#CII="golangci/golangci-lint:v1.50.1"
if [[ ! -d "$DOCKER_IMAGE_CACHE_DIR" ]]; then
mkdir -p "$DOCKER_IMAGE_CACHE_DIR"
@@ -16,21 +16,32 @@ function buildImageCache() {
mv $DICD/go.tzst.tmp $DICD/go.tzst
fi
if [[ ! -e "$DICD/ci.tzst" ]]; then
docker pull $CII
docker save $CII | pv | zstdmt -19 > $DICD/ci.tzst.tmp && \
mv $DICD/ci.tzst.tmp $DICD/ci.tzst
fi
#if [[ ! -e "$DICD/ci.tzst" ]]; then
# docker pull $CII
# docker save $CII | pv | zstdmt -19 > $DICD/ci.tzst.tmp && \
# mv $DICD/ci.tzst.tmp $DICD/ci.tzst
#fi
}
function loadImageCache() {
docker image ls $CII || \
zstdmt -d --stdout $DICD/ci.tzst | pv | docker load
# zstdmt -d --stdout $DICD/ci.tzst | pv | docker load
zstdmt -d --stdout $DICD/go.tzst | pv | docker load
docker image ls $GOI || \
zstdmt -d --stdout $DICD/go.tzst | pv | docker load
#docker image ls $CII
docker image ls $GOI
}
function writeModuleCache() {
if [[ ! -e $DICD/modcache.tar ]]; then
cd $(go env GOMODCACHE)
tar -c . | pv > $DICD/modcache.tar.tmp && mv $DICD/modcache.tar.tmp $DICD/modcache.tar
cd -
fi
cp -av $DICD/modcache.tar ./builddeps/modcache.tar.tmp && mv ./builddeps/modcache.tar.tmp ./builddeps/modcache.tar
}
buildImageCache
loadImageCache
writeModuleCache

6
bin/gitrev.sh Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
if [[ ! -z "$GITREV" ]]; then
echo $GITREV
else
git describe --always --dirty=-dirty
fi