I've noticed leakage of BUILDWORKER_TLS environment variable in build
logs, so lets fix it in a generic way via new
`cleanup_buildworker_env_variables()` by using Bash's parameter
expansion and unset all environment variables starting with BUILDWORKER_
prefix.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
#!/usr/bin/env bash
+cleanup_buildworker_env_variables() {
+ for var in "${!BUILDWORKER_@}"; do
+ unset "$var"
+ done
+}
+
[ -n "$BUILDWORKER_NAME" ] || {
echo "Please supply a name via --env BUILDWORKER_NAME=XXX" >&2
exit 1
echo "$BUILDWORKER_ADMIN" > /builder/info/admin
echo "$BUILDWORKER_DESCRIPTION" > /builder/info/host
-unset BUILDWORKER_ADMIN BUILDWORKER_DESCRIPTION BUILDWORKER_MASTER BUILDWORKER_NAME BUILDWORKER_PASSWORD
-
+cleanup_buildworker_env_variables
rm -f /builder/twistd.pid
exec /opt/venv/bin/buildbot-worker start --nodaemon /builder