Skip to content
This repository was archived by the owner on Oct 20, 2021. It is now read-only.

Commit 1461122

Browse files
authored
Update Build Script + Add Launch Script (#23)
1 parent 2907f7d commit 1461122

File tree

2 files changed

+30
-43
lines changed

2 files changed

+30
-43
lines changed

ci/build.sh

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,21 @@ cd "$(dirname "$0")/../"
55

66
ci/bootstrap.sh
77
.shared-ci/scripts/prepare-unity.sh
8+
.shared-ci/scripts/prepare-unity-mobile.sh "$(pwd)/logs/PrepareUnityMobile.log"
89

910
source .shared-ci/scripts/pinned-tools.sh
1011
source .shared-ci/scripts/profiling.sh
1112

1213
UNITY_PROJECT_DIR="$(pwd)/workers/unity"
1314

14-
# The asset cache ip cannot be hardcoded and so is stored in an environment variable on the build agent.
15-
# This is bash shorthand syntax for if-else predicated on the existance of the environment variable
16-
# where the else branch assigns an empty string.
17-
# i.e. -
18-
# if [ -z ${UNITY_ASSET_CACHE_IP} ]; then
19-
# ASSET_CACHE_ARG="-CacheServerIPAddress ${UNITY_ASSET_CACHE_IP}"
20-
# else
21-
# ASSET_CACHE_ARG=""
22-
# fi
23-
24-
ASSET_CACHE_ARG=${UNITY_ASSET_CACHE_IP:+-CacheServerIPAddress "${UNITY_ASSET_CACHE_IP}"}
25-
2615
markStartOfBlock "$0"
2716

28-
markStartOfBlock "Building UnityClient"
29-
30-
pushd "${UNITY_PROJECT_DIR}"
31-
dotnet run -p ../../.shared-ci/tools/RunUnity/RunUnity.csproj -- \
32-
-projectPath "${UNITY_PROJECT_DIR}" \
33-
-batchmode \
34-
-quit \
35-
-logfile "$(pwd)/../../logs/UnityClientBuild.log" \
36-
-executeMethod "Improbable.Gdk.BuildSystem.WorkerBuilder.Build" \
37-
${ASSET_CACHE_ARG} \
38-
+buildWorkerTypes "UnityClient" \
39-
+buildTarget "cloud"
40-
popd
41-
42-
markEndOfBlock "Building UnityClient"
43-
44-
markStartOfBlock "Building UnityGameLogic"
45-
46-
pushd "${UNITY_PROJECT_DIR}"
47-
dotnet run -p ../../.shared-ci/tools/RunUnity/RunUnity.csproj -- \
48-
-projectPath "${UNITY_PROJECT_DIR}" \
49-
-batchmode \
50-
-quit \
51-
-logfile "$(pwd)/../../logs/UnityGameLogicBuild.log" \
52-
-executeMethod "Improbable.Gdk.BuildSystem.WorkerBuilder.Build" \
53-
${ASSET_CACHE_ARG} \
54-
+buildWorkerTypes "UnityGameLogic" \
55-
+buildTarget "cloud"
56-
popd
57-
58-
markEndOfBlock "Building UnityGameLogic"
17+
.shared-ci/scripts/build.sh "${UNITY_PROJECT_DIR}" UnityClient cloud mono "$(pwd)/logs/UnityClientBuild.log"
18+
.shared-ci/scripts/build.sh "${UNITY_PROJECT_DIR}" UnityGameLogic cloud mono "$(pwd)/logs/UnityGameLogicBuild.log"
19+
.shared-ci/scripts/build.sh "${UNITY_PROJECT_DIR}" AndroidClient local mono "$(pwd)/logs/AndroidClientBuild-mono.log"
20+
21+
if isMacOS; then
22+
.shared-ci/scripts/build.sh "${UNITY_PROJECT_DIR}" iOSClient local il2cpp "$(pwd)/logs/iOSClientBuild.log"
23+
fi
5924

6025
markEndOfBlock "$0"

ci/upload-launch.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -u -o -x pipefail
4+
5+
cd "$(dirname "$0")/../"
6+
7+
PREFIX="blank"
8+
9+
ci/build.sh
10+
11+
source ".shared-ci/scripts/profiling.sh"
12+
source ".shared-ci/scripts/pinned-tools.sh"
13+
14+
setAssemblyName "${PREFIX}"
15+
16+
.shared-ci/scripts/upload-assemblies.sh "${ASSEMBLY_NAME}"
17+
18+
markStartOfBlock "Launching deployment"
19+
20+
spatial cloud launch "${ASSEMBLY_NAME}" cloud_launch.json "${ASSEMBLY_NAME}" --snapshot=snapshots/default.snapshot
21+
22+
markEndOfBlock "Launching deployment"

0 commit comments

Comments
 (0)