|
8 | 8 | Start-Event "deploy-game" "build-unreal-gdk-example-project-:windows:" |
9 | 9 | # Use the shortened commit hash gathered during GDK plugin clone and the current date and time to distinguish the deployment |
10 | 10 | $date_and_time = Get-Date -Format "MMdd_HHmm" |
11 | | - $deployment_name = "exampleproject_${date_and_time}_$($gdk_commit_hash)" |
| 11 | + $deployment_name = "exampleproject$($env:STEP_NUMBER)_${date_and_time}_$($gdk_commit_hash)" |
12 | 12 | $assembly_name = "$($deployment_name)_asm" |
13 | 13 |
|
14 | 14 | pushd "spatial" |
@@ -66,74 +66,21 @@ pushd "spatial" |
66 | 66 | "--snapshot=$deployment_snapshot_path", ` |
67 | 67 | "--cluster_region=$deployment_cluster_region", ` |
68 | 68 | "--log_level=debug", ` |
69 | | - "--tags=ttl_1_hours" |
| 69 | + "--tags=ttl_1_hours", ` |
| 70 | + "--deployment_description=`"Engine commit: $($env:ENGINE_COMMIT_HASH)`"" ` |
70 | 71 | ) |
71 | 72 |
|
72 | 73 | if ($launch_deployment_process.ExitCode -ne 0) { |
73 | 74 | Write-Log "Failed to launch a Spatial cloud deployment. Error: $($launch_deployment_process.ExitCode)" |
74 | 75 | Throw "Deployment launch failed" |
75 | 76 | } |
76 | 77 |
|
77 | | - # Send a Slack notification with a link to the new deployment and to the build. |
78 | | - # Read Slack webhook secret from the vault and extract the Slack webhook URL from it. |
79 | | - $slack_webhook_secret = "$(imp-ci secrets read --environment=production --buildkite-org=improbable --secret-type=slack-webhook --secret-name=unreal-gdk-slack-web-hook)" |
80 | | - $slack_webhook_url = $slack_webhook_secret | ConvertFrom-Json | %{$_.url} |
81 | | - |
82 | | - $deployment_url = "https://console.improbable.io/projects/${project_name}/deployments/${deployment_name}/overview" |
83 | | - $gdk_commit_url = "https://github.com/spatialos/UnrealGDK/tree/${gdk_commit_hash}" |
84 | | - $build_url = "$env:BUILDKITE_BUILD_URL" |
85 | | - |
86 | | - $json_message = [ordered]@{ |
87 | | - text = "Example Project build created by $env:BUILDKITE_BUILD_CREATOR succeeded and a deployment has been launched." |
88 | | - attachments= @( |
89 | | - @{ |
90 | | - fallback = "Find deployment here: $deployment_url and build here: $build_url" |
91 | | - color = "good" |
92 | | - fields= @( |
93 | | - @{ |
94 | | - title = "GDK branch" |
95 | | - value = "$gdk_branch_name" |
96 | | - short = "true" |
97 | | - } |
98 | | - @{ |
99 | | - title = "Example Project branch" |
100 | | - value = "$env:BUILDKITE_BRANCH" |
101 | | - short = "true" |
102 | | - } |
103 | | - ) |
104 | | - actions= @( |
105 | | - @{ |
106 | | - type = "button" |
107 | | - text = "Take me to the deployment" |
108 | | - url = "$deployment_url" |
109 | | - style = "primary" |
110 | | - } |
111 | | - @{ |
112 | | - type = "button" |
113 | | - text = "Take me to the GDK commit" |
114 | | - url = "$gdk_commit_url" |
115 | | - style = "primary" |
116 | | - } |
117 | | - @{ |
118 | | - type = "button" |
119 | | - text = "Take me to the build" |
120 | | - url = "$build_url" |
121 | | - style = "primary" |
122 | | - } |
123 | | - ) |
124 | | - } |
125 | | - ) |
126 | | - } |
127 | | - |
128 | | - $json_request = $json_message | ConvertTo-Json -Depth 10 |
129 | | - |
130 | | - Invoke-WebRequest -UseBasicParsing "$slack_webhook_url" -ContentType "application/json" -Method POST -Body "$json_request" |
131 | | - |
132 | | - } |
133 | | - else { |
| 78 | + buildkite-agent meta-data set "deployment-name-$($env:STEP_NUMBER)" "$deployment_name" |
| 79 | + buildkite-agent meta-data set "project-name" "$project_name" |
| 80 | + buildkite-agent meta-data set "gdk-commit-hash" "$gdk_commit_hash)" |
| 81 | + } else { |
134 | 82 | Write-Log "Deployment will not be launched as you have passed in an argument specifying that it should not be (START_DEPLOYMENT=${launch_deployment}). Remove it to have your build launch a deployment." |
135 | 83 | } |
136 | | - |
137 | 84 | Finish-Event "launch-deployment" "deploy-unreal-gdk-example-project-:windows:" |
138 | 85 |
|
139 | 86 | popd |
|
0 commit comments