From 2cc57c32b7681d856ae2e7e6598a0299ea07b5bc Mon Sep 17 00:00:00 2001 From: Ethan Paul Date: Wed, 28 Feb 2024 11:30:49 -0500 Subject: [PATCH] Fix error in usage of mkstemp function output --- configure.py | 9 ++++----- entrypoint.sh | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/configure.py b/configure.py index 0adc521..7aefde2 100644 --- a/configure.py +++ b/configure.py @@ -1,7 +1,8 @@ import sys import os import json -import tempfile + +CONSTRUCTED_CONFIG_FILE = "/tmp/runner-config.json" def main() -> str: @@ -20,12 +21,10 @@ def main() -> str: print(f"Missing required configuration value {err}", file=sys.stderr) sys.exit(1) - path = tempfile.mkstemp(prefix="semaphore-runner-") - - with open(path, "w") as outfile: + with open(CONSTRUCTED_CONFIG_FILE, "w") as outfile: json.dump(config, outfile, indent=4) - return path + sys.exit(0) if __name__ == "__main__": diff --git a/entrypoint.sh b/entrypoint.sh index a994ad2..97449e2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,4 +2,6 @@ set -e -semaphore runner --config="$(python /configure.py)" +python /configure.py + +semaphore runner --config=/tmp/runner-config.json