Skip to content

Commit 7eec130

Browse files
moskybtriarius
authored andcommitted
Fix missing equals
1 parent 4a5abec commit 7eec130

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packer/linux/conf/buildkite-agent/scripts/terminate-instance

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if [[ $BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB == "true" ]]; then
2323
#
2424
# We need to do this because if the call to terminate fails, the systemd unit will start up a new buildkite-agent process
2525
# on this machine, with state left over from the last agent, which is the opposite of what we want when $BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB is true.
26-
terminate "$region" "$instance_id" || shutdown
26+
terminate "$region" "$instance_id" || shutdown now
2727
else
2828
# If we're not in terminate-after-job mode, then it's fine for this to fail, as it'll be as if the instance never got shut down.
2929
terminate "$region" "$instance_id"

packer/windows/conf/bin/bk-install-elastic-stack.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,18 @@ Write-Output "Starting the Buildkite Agent"
212212

213213
nssm install buildkite-agent C:\buildkite-agent\bin\buildkite-agent.exe start
214214
If ($lastexitcode -ne 0) { Exit $lastexitcode }
215+
215216
nssm set buildkite-agent ObjectName .\$UserName $Password
216217
If ($lastexitcode -ne 0) { Exit $lastexitcode }
218+
217219
nssm set buildkite-agent AppStdout C:\buildkite-agent\buildkite-agent.log
218220
If ($lastexitcode -ne 0) { Exit $lastexitcode }
221+
219222
nssm set buildkite-agent AppStderr C:\buildkite-agent\buildkite-agent.log
220223
If ($lastexitcode -ne 0) { Exit $lastexitcode }
224+
221225
nssm set buildkite-agent AppEnvironmentExtra :HOME=C:\buildkite-agent
226+
If ($lastexitcode -ne 0) { Exit $lastexitcode }
222227

223228
If ((![string]::IsNullOrEmpty($Env:BUILDKITE_ENV_FILE_URL)) -And (Test-Path -Path C:\buildkite-agent\env -PathType leaf)) {
224229
foreach ($var in Get-Content C:\buildkite-agent\env) {
@@ -227,14 +232,15 @@ If ((![string]::IsNullOrEmpty($Env:BUILDKITE_ENV_FILE_URL)) -And (Test-Path -Pat
227232
}
228233
}
229234

230-
nssm set buildkite-agent AppEnvironmentExtra BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB $Env:BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB
235+
nssm set buildkite-agent AppEnvironmentExtra BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB=$Env:BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB
231236
If ($lastexitcode -ne 0) { Exit $lastexitcode }
232237

233-
If ($lastexitcode -ne 0) { Exit $lastexitcode }
234238
nssm set buildkite-agent AppExit Default Restart
235239
If ($lastexitcode -ne 0) { Exit $lastexitcode }
240+
236241
nssm set buildkite-agent AppRestartDelay 10000
237242
If ($lastexitcode -ne 0) { Exit $lastexitcode }
243+
238244
nssm set buildkite-agent AppEvents Exit/Post "powershell C:\buildkite-agent\bin\terminate-instance.ps1"
239245
If ($lastexitcode -ne 0) { Exit $lastexitcode }
240246

0 commit comments

Comments
 (0)