Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Oct 11, 2024
1 parent 5bc7223 commit b14ecdc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ fi
ci_dir=`cd $(dirname $0) && pwd`
source "$ci_dir/shared.sh"

git_repository=$(parse_stage0_file_by_key "git_repository")
nightly_branch=$(parse_stage0_file_by_key "nightly_branch")

# Add remote only if it doesn't exist
if ! git remote | grep -q "^${git_repository}$"; then
echo "Configuring remote upstream."
git remote add upstream "https://github.com/${git_repository}"
REMOTE_NAME="upstream"
else
REMOTE_NAME="origin"
fi

git fetch $REMOTE_NAME $nightly_branch

export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse

# suppress change-tracker warnings on CI
Expand Down
12 changes: 12 additions & 0 deletions src/ci/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,15 @@ function releaseChannel {
echo $RUST_CI_OVERRIDE_RELEASE_CHANNEL
fi
}

# Parse values from ./src/stage0 file by key
function parse_stage0_file_by_key {
local key="$1"
local file="$rust_root/src/stage0"
local value=$(awk -F= '{a[$1]=$2} END {print(a["'$key'"])}' $file)
if [ -z "$value" ]; then
echo "ERROR: Key '$key' not found in '$file'."
exit 1
fi
echo "$value"
}

0 comments on commit b14ecdc

Please sign in to comment.