"git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "f00cd6efbd00b0273f58c393a617415b5d1d410e"
Unverified Commit 2eaa58e0 authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[CI] refine status check (#3958)

parent 6e46bbf5
...@@ -4,17 +4,13 @@ JOB_NAME = os.getenv("JOB_NAME") ...@@ -4,17 +4,13 @@ JOB_NAME = os.getenv("JOB_NAME")
BUILD_NUMBER = os.getenv("BUILD_NUMBER") BUILD_NUMBER = os.getenv("BUILD_NUMBER")
BUILD_ID = os.getenv("BUILD_ID") BUILD_ID = os.getenv("BUILD_ID")
job_link = os.environ["BUILD_URL"] job_link = os.environ["BUILD_URL"]
response = requests.get('{}wfapi'.format(job_link)).json() response = requests.get('{}wfapi'.format(job_link)).json()
# IN_PROGRESS is expected, sincce the pipeline is not finished when executing this script status = "✅ CI test succeeded"
success = response["status"] in ['SUCCESS', 'IN_PROGRESS'] for v in response['stages']:
if 'FAILED' in v['status']:
if success: status = "❌ CI test failed in Stage [{}].".format(v['name'])
status = "✅ CI test succeeded" break
else:
status = "❌ CI test failed"
comment = f""" {JOB_NAME} comment = f""" {JOB_NAME}
{status} \n {status} \n
...@@ -22,4 +18,4 @@ Report at [link](https://dgl-ci-result.s3.us-west-2.amazonaws.com/{JOB_NAME}/{BU ...@@ -22,4 +18,4 @@ Report at [link](https://dgl-ci-result.s3.us-west-2.amazonaws.com/{JOB_NAME}/{BU
Full logs at [link](https://dgl-ci-result.s3.us-west-2.amazonaws.com/{JOB_NAME}/{BUILD_NUMBER}/{BUILD_ID}/logs/cireport.log) Full logs at [link](https://dgl-ci-result.s3.us-west-2.amazonaws.com/{JOB_NAME}/{BUILD_NUMBER}/{BUILD_ID}/logs/cireport.log)
""" """
print(comment) print(comment)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment