@@ -5,7 +5,6 @@ if [[ -n "${DEBUG-}" ]]; then
55 set -x
66fi
77
8-
98function isLinux() {
109 [[ " $( uname -s) " == " Linux" ]];
1110}
@@ -24,7 +23,8 @@ echo "--- Bootstrapping :boot:"
2423
2524SHARED_CI_DIR=" $( pwd) /.shared-ci"
2625CLONE_URL=
" [email protected] :spatialos/gdk-for-unity-shared-ci.git" 27- PINNED_SHARED_CI_VERSION=$( cat ./ci/shared-ci.pinned)
26+ PINNED_SHARED_CI_BRANCH=$( cat ./ci/shared-ci.pinned | cut -d' ' -f 1)
27+ PINNED_SHARED_CI_VERSION=$( cat ./ci/shared-ci.pinned | cut -d' ' -f 2)
2828
2929# Clone the HEAD of the shared CI repo into ".shared-ci"
3030
@@ -38,40 +38,47 @@ mkdir "${SHARED_CI_DIR}"
3838pushd " ${SHARED_CI_DIR} "
3939 git init
4040 git remote add origin " ${CLONE_URL} "
41- git fetch --depth 20 origin master
41+ git fetch --depth 20 origin " ${PINNED_SHARED_CI_BRANCH} "
4242 git checkout " ${PINNED_SHARED_CI_VERSION} "
4343popd
4444
4545# Clone the GDK for Unity repository
4646
4747CLONE_URI=
" [email protected] :spatialos/gdk-for-unity.git" 4848TARGET_DIRECTORY=" $( realpath $( pwd) /../gdk-for-unity) "
49- PINNED_VERSION=$( cat ./gdk.pinned)
49+ PINNED_BRANCH=$( cat ./gdk.pinned | cut -d' ' -f 1)
50+ PINNED_VERSION=$( cat ./gdk.pinned | cut -d' ' -f 2)
51+ SKIP_GDK=false
5052
5153if [[ -z ${BUILDKITE:- } ]]; then
5254 echo " Warning: About to delete ${TARGET_DIRECTORY} . Please confirm. (Default is Cancel)"
53- read -p " Y/N > " -r
55+ read -p " Y/N/S > " -r
5456 echo # (optional) move to a new line
5557 if [[ $REPLY =~ ^[Yy]$ ]]; then
5658 echo " Deleting..."
59+ elif [[ $REPLY =~ ^[Ss]$ ]]; then
60+ echo " Skipping..."
61+ SKIP_GDK=true
5762 else
5863 exit 1
5964 fi
6065fi
6166
62- rm -rf " ${TARGET_DIRECTORY} "
67+ if [ " $SKIP_GDK " = false ] ; then
68+ rm -rf " ${TARGET_DIRECTORY} "
6369
64- mkdir " ${TARGET_DIRECTORY} "
70+ mkdir " ${TARGET_DIRECTORY} "
6571
66- # Workaround for being unable to clone a specific commit with depth of 1.
67- pushd " ${TARGET_DIRECTORY} "
68- git init
69- git remote add origin " ${CLONE_URI} "
70- git fetch --depth 20 origin develop
71- git checkout " ${PINNED_VERSION} "
72- echo " --- Hit init :right-facing_fist::red_button:"
73- ./init.sh
74- popd
72+ # Workaround for being unable to clone a specific commit with depth of 1.
73+ pushd " ${TARGET_DIRECTORY} "
74+ git init
75+ git remote add origin " ${CLONE_URI} "
76+ git fetch --depth 20 origin " ${PINNED_BRANCH} "
77+ git checkout " ${PINNED_VERSION} "
78+ echo " --- Hit init :right-facing_fist::red_button:"
79+ ./init.sh
80+ popd
81+ fi
7582
7683echo " --- Symlinking packages :link::package:"
7784
0 commit comments