Fix automatic bucket_prefix, exit 1 on failures

This commit is contained in:
Mikhail f. Shiryaev 2022-05-20 00:06:44 +02:00
parent bfe0fbc701
commit 39097a4cfc
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -5,6 +5,7 @@ import argparse
import json import json
import logging import logging
import subprocess import subprocess
import sys
from os import path as p, makedirs from os import path as p, makedirs
from typing import List, Tuple from typing import List, Tuple
@ -292,7 +293,7 @@ def main():
pr_info = None pr_info = None
if CI: if CI:
pr_info = PRInfo() pr_info = PRInfo()
release_or_pr = get_release_or_pr(pr_info, args.version) release_or_pr, _ = get_release_or_pr(pr_info, args.version)
args.bucket_prefix = ( args.bucket_prefix = (
f"https://s3.amazonaws.com/{S3_BUILDS_BUCKET}/" f"https://s3.amazonaws.com/{S3_BUILDS_BUCKET}/"
f"{release_or_pr}/{pr_info.sha}" f"{release_or_pr}/{pr_info.sha}"
@ -350,6 +351,8 @@ def main():
) )
ch_helper = ClickHouseHelper() ch_helper = ClickHouseHelper()
ch_helper.insert_events_into(db="default", table="checks", events=prepared_events) ch_helper.insert_events_into(db="default", table="checks", events=prepared_events)
if status != "success":
sys.exit(1)
if __name__ == "__main__": if __name__ == "__main__":