Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit e9569a7

Browse files
authored
Add release QA pipeline for buildkite (#733)
1 parent 6ff30d6 commit e9569a7

File tree

4 files changed

+108
-4
lines changed

4 files changed

+108
-4
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
agent_queue_id: trigger-pipelines
2+
description: GDK for Unity release QA pipeline
3+
github:
4+
branch_configuration: []
5+
default_branch: develop
6+
pull_request_branch_filter_configuration: []
7+
teams:
8+
- name: Everyone
9+
permission: BUILD_AND_READ
10+
- name: gbu/develop/unity
11+
permission: MANAGE_BUILD_AND_READ

.buildkite/release-qa.steps.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
# Generated by <circle ci pipeline new>; this file *should* be edited manually to add or modify steps.
3+
#
4+
# Steps are executed based on the version in version control, and so you *do not* need to upload changes to BuildKite, just
5+
# commit them and send a PR to GitHub as you normally would.
6+
#
7+
# You may find the example pipeline steps listed here helpful: https://buildkite.com/docs/pipelines/defining-steps#example-pipeline but please
8+
# note that the setup is already done, so you should not manually adjust anything through the BuildKite interface.
9+
#
10+
common: &common
11+
agents:
12+
- "capable_of_building=gdk-for-unity"
13+
- "environment=production"
14+
- "permission_set=builder"
15+
- "platform=windows"
16+
- "queue=v2-1548806151-96e92a815a76456b-------z"
17+
timeout_in_minutes: 60 # TODO(ENG-548): reduce timeout once agent-cold-start is optimised.
18+
retry:
19+
automatic:
20+
# This is designed to trap and retry failures because agent lost connection. Agent exits with -1 in this case.
21+
- exit_status: -1
22+
limit: 3
23+
24+
# NOTE: step labels turn into commit-status names like {org}/{repo}/{pipeline}/{step-label}, lower-case and hyphenated.
25+
# These are then relied on to have stable names by other things, so once named, please beware renaming has consequences.
26+
27+
steps:
28+
- label: "build :android:"
29+
command: bash -c ci/build.sh
30+
<<: *common
31+
artifact_paths:
32+
- logs/**/*
33+
- build/assembly/**/*
34+
env:
35+
WORKER_TYPE: "AndroidClient"
36+
BUILD_TARGET: "local"
37+
SCRIPTING_TYPE: "mono"
38+
39+
- label: "build :iphone:"
40+
command: bash -c ci/build.sh
41+
<<: *common
42+
artifact_paths:
43+
- logs/**/*
44+
- build/assembly/**/*
45+
env:
46+
WORKER_TYPE: "iOSClient"
47+
BUILD_TARGET: "local"
48+
SCRIPTING_TYPE: "il2cpp"
49+
50+
- label: "build UnityClient mono"
51+
command: bash -c ci/build.sh
52+
<<: *common
53+
artifact_paths:
54+
- logs/**/*
55+
- build/assembly/**/*
56+
env:
57+
WORKER_TYPE: "UnityClient"
58+
BUILD_TARGET: "cloud"
59+
SCRIPTING_TYPE: "mono"
60+
61+
- label: "build UnityGameLogic mono"
62+
command: bash -c ci/build.sh
63+
<<: *common
64+
artifact_paths:
65+
- logs/**/*
66+
- build/assembly/**/*
67+
env:
68+
WORKER_TYPE: "UnityGameLogic"
69+
BUILD_TARGET: "cloud"
70+
SCRIPTING_TYPE: "mono"
71+
- wait
72+
- label: Launch deployment
73+
command: bash -c ci/upload-launch.sh
74+
<<: *common
75+

ci/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ fi
3030
LOG_LOCATION="$(pwd)/logs/${WORKER_TYPE}-${BUILD_TARGET}-${SCRIPTING_TYPE}.log"
3131

3232
.shared-ci/scripts/build.sh "workers/unity" ${WORKER_TYPE} ${BUILD_TARGET} ${SCRIPTING_TYPE} "${LOG_LOCATION}"
33+
spatial prepare-for-run

ci/upload-launch.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,34 @@ cd "$(dirname "$0")/../"
66

77
PREFIX="playground"
88

9-
ci/build-test.sh
10-
119
source ".shared-ci/scripts/profiling.sh"
1210
source ".shared-ci/scripts/pinned-tools.sh"
1311

12+
if [[ -n "${BUILDKITE-}" ]]; then
13+
# In buildkite, download the artifacts and reconstruct the build/assemblies folder.
14+
buildkite-agent artifact download "build\assembly\**\*" .
15+
else
16+
# In TeamCity, just build.
17+
ci/build-test.sh
18+
fi
19+
1420
setAssemblyName "${PREFIX}"
1521

16-
.shared-ci/scripts/upload-assemblies.sh "${ASSEMBLY_NAME}"
22+
spatial cloud upload "${ASSEMBLY_NAME}" --log_level=debug --force --enable_pre_upload_check=false
1723

1824
markStartOfBlock "Launching deployment"
1925

20-
spatial cloud launch "${ASSEMBLY_NAME}" cloud_launch.json "${ASSEMBLY_NAME}" --snapshot=snapshots/default.snapshot
26+
spatial cloud launch "${ASSEMBLY_NAME}" cloud_launch.json "${ASSEMBLY_NAME}" --snapshot=snapshots/default.snapshot | tee -a ./launch.log
27+
28+
if [[ -n "${BUILDKITE-}" ]]; then
29+
CONSOLE_REGEX='.*Console URL:(.*)\\n"'
30+
LAUNCH_LOG=$(cat ./launch.log)
31+
if [[ $LAUNCH_LOG =~ $CONSOLE_REGEX ]]; then
32+
CONSOLE_URL=${BASH_REMATCH[1]}
33+
buildkite-agent annotate --style "success" "Deployment URL: ${CONSOLE_URL}"
34+
else
35+
buildkite-agent annotate --style "warning" "Could not parse deployment URL from launch log."
36+
fi
37+
fi
2138

2239
markEndOfBlock "Launching deployment"

0 commit comments

Comments
 (0)