-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[testing] Enable image build testing for unmerged avalanchego version
- Loading branch information
Showing
5 changed files
with
65 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# Defines functions for interacting with git clones of the avalanchego repo. | ||
|
||
if [[ -z "${SUBNET_EVM_PATH}" ]]; then | ||
echo "SUBNET_EVM_PATH must be set" | ||
exit 1 | ||
fi | ||
|
||
export AVALANCHEGO_CLONE_PATH=${AVALANCHEGO_CLONE_PATH:-${SUBNET_EVM_PATH}/avalanchego} | ||
|
||
# Clones the avalanchego repo to the given path and checks out specified version. | ||
function clone_avalanchego { | ||
local avalanche_version="$1" | ||
|
||
echo "checking out target avalanchego version ${avalanche_version}" | ||
if [[ -d "${AVALANCHEGO_CLONE_PATH}" ]]; then | ||
echo "updating existing clone" | ||
cd "${AVALANCHEGO_CLONE_PATH}" | ||
git fetch | ||
else | ||
echo "creating new clone" | ||
git clone https://github.com/ava-labs/avalanchego.git "${AVALANCHEGO_CLONE_PATH}" | ||
cd "${AVALANCHEGO_CLONE_PATH}" | ||
fi | ||
# Branch will be reset to $avalanche_version if it already exists | ||
git checkout -B "test-${avalanche_version}" "${avalanche_version}" | ||
cd "${SUBNET_EVM_PATH}" | ||
} | ||
|
||
# Derives an image tag from the current state of the avalanchego clone | ||
function avalanchego_image_tag_from_clone { | ||
local commit_hash="$(git --git-dir="${AVALANCHEGO_CLONE_PATH}/.git" rev-parse HEAD)" | ||
echo "${commit_hash::8}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters