Skip to content

Instantly share code, notes, and snippets.

@ianhays
Created April 2, 2018 21:04
Show Gist options
  • Save ianhays/51411d5b7db66f23eb2bd07724eeec0f to your computer and use it in GitHub Desktop.
Save ianhays/51411d5b7db66f23eb2bd07724eeec0f to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# -----------------------------------------------------------------------------------------
# SetupRepos
# Arg1 - Origin owner
# Arg2 - release version
# -----------------------------------------------------------------------------------------
function SetupRepos() {
SetupRepo $1 $2 corefx
SetupRepo $1 $2 coreclr
SetupRepo $1 $2 core-setup
SetupRepo $1 $2 buildtools
}
# -----------------------------------------------------------------------------------------
# SetupRepo
# Arg1 - Origin owner
# Arg2 - release version
# Arg3 - repo name
# -----------------------------------------------------------------------------------------
function SetupRepo() {
git clone git@github.com:$1/$3.git
pushd $3
git remote add upstream git@github.com:dotnet/$3.git
git fetch upstream release/$2
git checkout upstream/release/$2
popd
}
# -----------------------------------------------------------------------------------------
# BuildManaged
# Arg1 -
# -----------------------------------------------------------------------------------------
function BuildManaged() {
pushd corefx
./build.sh release
popd
pushd coreclr
./build.sh linuxmscorlib release
popd
pushd core-setup
./build.sh release
popd
pushd buildtools
./build.sh
popd
}
# -----------------------------------------------------------------------------------------
# main
# Arg1 - Command to be executed
# Args2... args to the specific command to be executed
# -----------------------------------------------------------------------------------------
if [ "$1" == "SetupRepos" ]; then
SetupRepos $2 $3
elif [ "$1" == "BuildManaged" ]; then
BuildManaged
else
echo "Must provide a command"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment