-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated extended block log creation job to be able to build from spec…
…ific commit
- Loading branch information
Showing
4 changed files
with
49 additions
and
4 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
File renamed without changes.
42 changes: 42 additions & 0 deletions
42
scripts/ci-helpers/prepare_extended_mirrornet_block_log_for_commit.sh
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,42 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Preparing environment..." | ||
|
||
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit 1; pwd -P )" | ||
SCRIPTSDIR="$SCRIPTPATH/.." | ||
SRC_DIR="$(realpath "${SCRIPTSDIR}/..")" | ||
|
||
export LOG_FILE=build_instance4commit.log | ||
# shellcheck source=../common.sh | ||
source "$SCRIPTSDIR/common.sh" | ||
|
||
HIVE_SRC="${HIVE_SRC:-${SRC_DIR}}" | ||
HIVE_COMMIT="${HIVE_COMMIT:-${CI_COMMIT_SHORT_SHA:-$1}}" | ||
|
||
echo "Hive source located at ${HIVE_SRC}. Requested commit: ${HIVE_COMMIT}" | ||
|
||
pushd "${HIVE_SRC}" | ||
git fetch | ||
CURRENT_COMMIT=$(git rev-parse --verify HEAD) | ||
TARGET_COMMIT=$(git rev-parse --verify "${HIVE_COMMIT}") | ||
|
||
echo -e "Current commit: ${CURRENT_COMMIT}.\nDesired commit: ${TARGET_COMMIT}" | ||
|
||
if [ "${TARGET_COMMIT}" != "${CURRENT_COMMIT}" ]; then | ||
git config --global init.defaultBranch "develop" # Suppress default branch name warning | ||
do_clone "develop" "${HIVE_SRC}/hive-${TARGET_COMMIT}" https://gitlab.syncad.com/hive/hive.git "${TARGET_COMMIT}" | ||
HIVE_SRC="${HIVE_SRC}/hive-${TARGET_COMMIT}" | ||
pushd "${HIVE_SRC}" | ||
echo "Hive source changed to ${HIVE_SRC}" | ||
fi | ||
|
||
"${HIVE_SRC}/scripts/ci-helpers/prepare_extended_mirrornet_block_log.sh" | ||
|
||
if [ "${TARGET_COMMIT}" != "${CURRENT_COMMIT}" ]; then | ||
popd | ||
rm -rf "${HIVE_SRC}" | ||
fi | ||
|
||
popd |