2023-01-19 08:57:51 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
source="${BASH_SOURCE[0]}"
|
|
|
|
script_root="$( cd -P "$( dirname "$source" )" && pwd )"
|
|
|
|
|
|
|
|
installer_dir=$(realpath "$script_root/../..")
|
|
|
|
workspace_dir=$(realpath "$installer_dir/../")
|
|
|
|
tmp_dir=$(realpath "$workspace_dir/tmp")
|
|
|
|
vmr_dir=$(realpath "$workspace_dir/dotnet")
|
|
|
|
|
2023-03-13 13:44:42 +00:00
|
|
|
cp "$installer_dir/.devcontainer/vmr-source-build/synchronize-vmr.sh" "$workspace_dir"
|
|
|
|
|
2023-01-19 08:57:51 +00:00
|
|
|
mkdir -p "$tmp_dir"
|
|
|
|
|
|
|
|
# Codespaces performs a shallow fetch only
|
|
|
|
git -C "$installer_dir" fetch --all --unshallow
|
|
|
|
|
|
|
|
# We will try to figure out, which branch is the current (PR) branch based off of
|
|
|
|
# We need this to figure out, which VMR branch to use
|
2023-02-17 16:39:17 +00:00
|
|
|
vmr_branch=$(git -C "$installer_dir" log --pretty=format:'%D' HEAD^ \
|
2023-03-13 13:44:42 +00:00
|
|
|
| grep 'origin/' \
|
|
|
|
| head -n1 \
|
2023-02-17 16:39:17 +00:00
|
|
|
| sed 's@origin/@@' \
|
|
|
|
| sed 's@,.*@@')
|
2023-01-19 08:57:51 +00:00
|
|
|
|
2023-03-28 15:03:36 +00:00
|
|
|
"$workspace_dir/synchronize-vmr.sh" --branch "$vmr_branch" --debug
|
2023-03-13 13:44:42 +00:00
|
|
|
|
|
|
|
(cd "$vmr_dir" && ./prep.sh)
|