workflows changes 7
This commit is contained in:
@@ -6,7 +6,6 @@ set -eu
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
repo_root="$(cd ../../.. && pwd)"
|
||||
checkout_ref="$(git -C "$repo_root" rev-parse HEAD)"
|
||||
|
||||
if [ "${2:-}" ]; then
|
||||
cpu_set="--cpuset-cpus $2"
|
||||
@@ -14,9 +13,17 @@ else
|
||||
cpu_set=""
|
||||
fi
|
||||
|
||||
cache_args=""
|
||||
if [ -n "${P2POOL_BUILD_CACHE:-}" ]; then
|
||||
cache_dir="${P2POOL_BUILD_CACHE%/}/linux_x64"
|
||||
mkdir -p "$cache_dir"
|
||||
export DOCKER_BUILDKIT=1
|
||||
cache_args="--build-arg BUILDKIT_INLINE_CACHE=1 --cache-from type=local,src=$cache_dir --cache-to type=local,dest=$cache_dir,mode=max"
|
||||
fi
|
||||
|
||||
docker build $cpu_set \
|
||||
--build-arg P2POOL_VERSION=$1 \
|
||||
--build-arg P2POOL_CHECKOUT=$checkout_ref \
|
||||
$cache_args \
|
||||
-t p2pool_linux_x64_build_$1 \
|
||||
-f Dockerfile "$repo_root"
|
||||
|
||||
|
||||
@@ -2,15 +2,22 @@
|
||||
set -e
|
||||
|
||||
cd /p2pool
|
||||
git fetch --jobs=$(nproc)
|
||||
CHECKOUT_REF=${P2POOL_CHECKOUT:-$2}
|
||||
if [ -z "$CHECKOUT_REF" ]; then
|
||||
echo "No checkout ref provided. Pass a version/tag as argument 2 or set P2POOL_CHECKOUT."
|
||||
exit 1
|
||||
fi
|
||||
if ! git rev-parse --verify --quiet "$CHECKOUT_REF^{commit}" >/dev/null; then
|
||||
echo "Requested ref '$CHECKOUT_REF' is not present in the build context."
|
||||
exit 1
|
||||
fi
|
||||
echo "Checking out ${CHECKOUT_REF} (version label $2)"
|
||||
git checkout "$CHECKOUT_REF"
|
||||
git checkout --detach "$CHECKOUT_REF"
|
||||
git -c submodule.external/src/grpc.update=none submodule update --recursive --jobs $(nproc)
|
||||
|
||||
export TZ=UTC0
|
||||
|
||||
BUILD_TIMESTAMP=$(git show --no-patch --format=%ct $2)
|
||||
BUILD_TIMESTAMP=$(git show --no-patch --format=%ct "$CHECKOUT_REF")
|
||||
CURRENT_DATE=$(date -u -d @$BUILD_TIMESTAMP +"%Y-%m-%d")
|
||||
CURRENT_TIME=$(date -u -d @$BUILD_TIMESTAMP +"%H:%M:%S")
|
||||
TOUCH_DATE=$(date -u -d @$BUILD_TIMESTAMP +"%Y%m%d%H%M.%S")
|
||||
|
||||
Reference in New Issue
Block a user