Skip to content

Commit 0ab5f6a

Browse files
authored
Added environment variable set pipeline status.
Added environment variable check for pipeline status.
1 parent 1e3a341 commit 0ab5f6a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

resultParser.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import sys, json
1+
import sys, json, os
22

33
def print_error_message(result):
44
error_message = ""
@@ -32,9 +32,13 @@ def print_failed_checks(output):
3232
failed_checks = False
3333
for result in output.get("result"):
3434
failed_checks = print_error_message(result)
35+
failBuild = os.getenv("failBuild", "true").lower() == "true"
3536
if failed_checks:
36-
exit(-1)
37-
37+
if failBuild :
38+
print("Pipeline status will be - Failed")
39+
exit(-1)
40+
else:
41+
print("Pipeline status will be - Successful")
3842

3943
# Press the green button in the gutter to run the script.
4044
if __name__ == '__main__':

0 commit comments

Comments
 (0)