File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -361,8 +361,17 @@ done
361
361
echo " Waited $next_wait_time times for docker to start. We will exit if it still has not started."
362
362
check_docker
363
363
364
- # also set in /var/lib/buildkite-agent/cfn-env so that its shown in the job logs
365
- systemctl set-environment " BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB=${BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB} "
364
+ echo Writing buildkite-agent systemd environment override...
365
+ # also set in /var/lib/buildkite-agent/cfn-env so that it's shown in the job logs
366
+ mkdir -p /etc/systemd/system/buildkite-agent.service.d
367
+ cat << EOF | tee /etc/systemd/system/buildkite-agent.service.d/environment.conf
368
+ [Service]
369
+ Environment="BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB=${BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB} "
370
+ EOF
371
+
372
+ echo Reloading systemctl services...
373
+ systemctl daemon-reload
374
+
366
375
echo Starting buildkite-agent...
367
376
systemctl enable --now buildkite-agent
368
377
You can’t perform that action at this time.
0 commit comments