bpo/submit.py: require and pass BPO_JOB_{ID,NAME}
Let's send both to to the bpo server with each request. This is needed to handle failing jobs (we need to know which job exactly is failing). Note that this is not directly using a sourcehut specific environment variable, because with bpo it is also possible to choose a "local" job service for testing (manual and testsuite). The local job service will just generate a random number as job id and place that in this variable.
This commit is contained in:
parent
90d3deb7b4
commit
a328a64a80
1 changed files with 4 additions and 0 deletions
|
@ -12,6 +12,8 @@ for key in ["BPO_API_ENDPOINT",
|
|||
"BPO_API_HOST",
|
||||
"BPO_ARCH",
|
||||
"BPO_BRANCH",
|
||||
"BPO_JOB_ID",
|
||||
"BPO_JOB_NAME",
|
||||
"BPO_TOKEN_FILE",
|
||||
"BPO_PAYLOAD_FILES", # one file per line
|
||||
"BPO_PAYLOAD_IS_JSON", # set to "1" to enable
|
||||
|
@ -42,6 +44,8 @@ is_json = (os.environ["BPO_PAYLOAD_IS_JSON"] == "1")
|
|||
# Prepare HTTP headers
|
||||
headers = {"X-BPO-Arch": os.environ["BPO_ARCH"],
|
||||
"X-BPO-Branch": os.environ["BPO_BRANCH"],
|
||||
"X-BPO-Job-Id": os.environ["BPO_JOB_ID"],
|
||||
"X-BPO-Job-Name": os.environ["BPO_JOB_NAME"],
|
||||
"X-BPO-Token": token,
|
||||
"X-BPO-Pkgname": os.environ["BPO_PKGNAME"],
|
||||
"X-BPO-Version": os.environ["BPO_VERSION"]}
|
||||
|
|
Loading…
Reference in a new issue