mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
30 lines
974 B
Bash
30 lines
974 B
Bash
#!/usr/bin/env bash
|
|
|
|
# Set the PATHS
|
|
GOPATH="$(go env GOPATH)"
|
|
|
|
# Avalabs docker hub
|
|
dockerhub_repo="avaplatform/avalanchego"
|
|
|
|
# Current branch
|
|
current_branch=${CURRENT_BRANCH:-$(git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git rev-parse --short HEAD)}
|
|
echo "Using branch: ${current_branch}"
|
|
|
|
# Image build id
|
|
# Use an abbreviated version of the full commit to tag the image.
|
|
|
|
# WARNING: this will use the most recent commit even if there are un-committed changes present
|
|
subnet_evm_commit="$(git --git-dir="$SUBNET_EVM_PATH/.git" rev-parse HEAD)"
|
|
subnet_evm_commit_id="${subnet_evm_commit::8}"
|
|
|
|
build_image_id=${BUILD_IMAGE_ID:-"$avalanche_version-$subnet_evm_commit_id"}
|
|
|
|
# Static compilation
|
|
static_ld_flags=''
|
|
if [ "${STATIC_COMPILATION:-}" = 1 ]
|
|
then
|
|
export CC=musl-gcc
|
|
command -v $CC || ( echo $CC must be available for static compilation && exit 1 )
|
|
static_ld_flags=' -extldflags "-static" -linkmode external '
|
|
fi
|