Files
evm/scripts/lib_avalanchego_clone.sh
zeekay 8bc9dd01a8 Fix CI: Go version and script permissions
- Change Go version from 1.24.6 to 1.22.8 (stable version)
- Ensure all build scripts have executable permissions
- Fix covdata issue by using stable Go version
- CI should now pass all checks
2025-09-19 05:56:47 +00:00

39 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Defines functions for interacting with git clones of the luxd repo.
if [[ -z "${EVM_PATH}" ]]; then
echo "EVM_PATH must be set"
exit 1
fi
export LUXD_CLONE_PATH=${LUXD_CLONE_PATH:-${EVM_PATH}/luxd}
# Clones the luxd repo to the configured path and checks out the specified version.
function clone_luxd {
local lux_version="$1"
echo "checking out target luxd version ${lux_version} to ${LUXD_CLONE_PATH}"
if [[ -d "${LUXD_CLONE_PATH}" ]]; then
echo "updating existing clone"
cd "${LUXD_CLONE_PATH}"
git fetch
else
echo "creating new clone"
git clone https://github.com/luxfi/luxd.git "${LUXD_CLONE_PATH}"
cd "${LUXD_CLONE_PATH}"
fi
# Branch will be reset to $lux_version if it already exists
git checkout -B "test-${lux_version}" "${lux_version}"
cd "${EVM_PATH}"
}
# Derives an image tag from the current state of the luxd clone
function luxd_image_tag_from_clone {
local commit_hash
commit_hash="$(git --git-dir="${LUXD_CLONE_PATH}/.git" rev-parse HEAD)"
echo "${commit_hash::8}"
}