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

Commit e2324e3

Browse files
authored
Add premerge/release-qa buildkite pipelines (#30)
1 parent 262cf0d commit e2324e3

File tree

10 files changed

+211
-22
lines changed

10 files changed

+211
-22
lines changed

.buildkite/hooks/post-checkout

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
[[ -n "${DEBUG:-}" ]] && set -x
4+
5+
ci/bootstrap.sh

.buildkite/hooks/post-command

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
[[ -n "${DEBUG:-}" ]] && set -x
4+
5+
# Only run purge script on Windows agents, as `premerge` runs on a Linux box
6+
if [[ ${BUILDKITE_AGENT_META_DATA_OS} == "windows" ]]; then
7+
powershell -NoProfile -NonInteractive .shared-ci/scripts/purge.ps1 -projectRoot "$(pwd)/"
8+
fi

.buildkite/hooks/pre-command

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
[[ -n "${DEBUG:-}" ]] && set -x
4+
5+
if [[ "${BUILDKITE_AGENT_META_DATA_CAPABLE_OF_BUILDING}" == "gdk-for-unity" ]]; then
6+
spatial auth login --log_level debug
7+
fi
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
agent_queue_id: trigger-pipelines
3+
description: GDK for Unity Blank Project pre-merge CI pipeline.
4+
github:
5+
branch_configuration: []
6+
default_branch: develop
7+
pull_request_branch_filter_configuration: []
8+
teams:
9+
- name: Everyone
10+
permission: BUILD_AND_READ
11+
- name: gbu/develop/unity
12+
permission: MANAGE_BUILD_AND_READ

.buildkite/premerge.steps.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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-1550169760-797337f060834fd6-------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 .shared-ci/scripts/build-worker.sh
30+
<<: *common
31+
artifact_paths:
32+
- logs/**/*
33+
env:
34+
WORKER_TYPE: "AndroidClient"
35+
BUILD_TARGET: "local"
36+
SCRIPTING_TYPE: "mono"
37+
38+
- label: "build UnityClient mono"
39+
command: bash -c .shared-ci/scripts/build-worker.sh
40+
<<: *common
41+
artifact_paths:
42+
- logs/**/*
43+
env:
44+
WORKER_TYPE: "UnityClient"
45+
BUILD_TARGET: "cloud"
46+
SCRIPTING_TYPE: "mono"
47+
48+
- label: "build UnityClient il2cpp"
49+
command: bash -c .shared-ci/scripts/build-worker.sh
50+
<<: *common
51+
artifact_paths:
52+
- logs/**/*
53+
env:
54+
WORKER_TYPE: "UnityClient"
55+
BUILD_TARGET: "local"
56+
SCRIPTING_TYPE: "il2cpp"
57+
58+
- label: "build UnityGameLogic mono"
59+
command: bash -c .shared-ci/scripts/build-worker.sh
60+
<<: *common
61+
artifact_paths:
62+
- logs/**/*
63+
env:
64+
WORKER_TYPE: "UnityGameLogic"
65+
BUILD_TARGET: "cloud"
66+
SCRIPTING_TYPE: "mono"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
agent_queue_id: trigger-pipelines
3+
description: GDK for Unity Blank Project release QA pipeline
4+
github:
5+
branch_configuration: []
6+
default_branch: develop
7+
pull_request_branch_filter_configuration: []
8+
teams:
9+
- name: Everyone
10+
permission: BUILD_AND_READ
11+
- name: gbu/develop/unity
12+
permission: MANAGE_BUILD_AND_READ

.buildkite/release-qa.steps.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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-1550169760-797337f060834fd6-------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 .shared-ci/scripts/build-worker.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 UnityClient mono"
40+
command: bash -c .shared-ci/scripts/build-worker.sh
41+
<<: *common
42+
artifact_paths:
43+
- logs/**/*
44+
- build/assembly/**/*
45+
env:
46+
WORKER_TYPE: "UnityClient"
47+
BUILD_TARGET: "cloud"
48+
SCRIPTING_TYPE: "mono"
49+
50+
- label: "build UnityGameLogic mono"
51+
command: bash -c .shared-ci/scripts/build-worker.sh
52+
<<: *common
53+
artifact_paths:
54+
- logs/**/*
55+
- build/assembly/**/*
56+
env:
57+
WORKER_TYPE: "UnityGameLogic"
58+
BUILD_TARGET: "cloud"
59+
SCRIPTING_TYPE: "mono"
60+
- wait
61+
- label: Launch deployments
62+
command: bash -c ci/launch.sh
63+
<<: *common
64+
env:
65+
ASSEMBLY_PREFIX: "blank"
66+
PROJECT_NAME: "unity_gdk"

.buildkite/trigger.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
# https://brevi.link/shell-style
3+
# https://explainshell.com
4+
set -euo pipefail
5+
if [[ -n "${DEBUG-}" ]]; then
6+
set -x
7+
fi
8+
cd "$(dirname "$0")/../"
9+
10+
# The step-definitions file is uploaded dynamically to preserve ability for historical builds
11+
# vs changes in CI pipeline configuration.
12+
buildkite-agent pipeline upload "$1"

ci/launch.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -u -x -o pipefail
4+
5+
cd "$(dirname "$0")/../"
6+
7+
source ".shared-ci/scripts/profiling.sh"
8+
source ".shared-ci/scripts/pinned-tools.sh"
9+
10+
# Download the artifacts and reconstruct the build/assemblies folder.
11+
buildkite-agent artifact download "build\assembly\**\*" .
12+
13+
uploadAssembly "${ASSEMBLY_PREFIX}" "${PROJECT_NAME}"
14+
15+
markStartOfBlock "Launching deployments"
16+
17+
spatial cloud launch "${ASSEMBLY_NAME}" cloud_launch.json "${ASSEMBLY_NAME}" --snapshot=snapshots/default.snapshot
18+
19+
CONSOLE_URL="https://console.improbable.io/projects/${PROJECT_NAME}/deployments/${ASSEMBLY_NAME}/overview"
20+
21+
buildkite-agent annotate --style "success" "Deployment URL: ${CONSOLE_URL}"
22+
23+
markEndOfBlock "Launching deployments"

ci/upload-launch.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)