Commit beee6350 authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

Fix wrong pipeline for statuses

parent 46770ad2
...@@ -245,14 +245,14 @@ TODO : ...@@ -245,14 +245,14 @@ TODO :
""" """
if __name__ == "__main__": if __name__ == "__main__":
if ( len(sys.argv) < 5 ): if ( len(sys.argv) < 6 ):
print("Usage : "+sys.argv[0]+" commit_sha1 project_id build_directory token") print("Usage : "+sys.argv[0]+" commit_sha1 project_id build_directory token ref_name")
sys.exit() sys.exit()
if trace: if trace:
print (sys.argv) print (sys.argv)
handler = Handler() handler = Handler()
build_dir = os.path.join( sys.argv[3] , "build/") build_dir = os.path.join( sys.argv[3] , "build/")
# build_dir = sys.argv[3] ref_name = sys.argv[5]
if trace: if trace:
print("build_dir is: " + build_dir) print("build_dir is: " + build_dir)
handler.build_dir = build_dir handler.build_dir = build_dir
...@@ -271,7 +271,7 @@ if __name__ == "__main__": ...@@ -271,7 +271,7 @@ if __name__ == "__main__":
gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/" gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/"
gitlab_url += sys.argv[2] + "/statuses/" + sys.argv[1] gitlab_url += sys.argv[2] + "/statuses/" + sys.argv[1]
params = urllib.parse.urlencode({'name':'cdash:' + handler.site , 'state': state ,\ params = urllib.parse.urlencode({'name':'cdash:' + handler.site , 'state': state ,\
'target_url' : cdash_url , 'description' : error }) 'target_url' : cdash_url , 'description' : error , 'ref' : ref_name })
gitlab_request = urllib.request.Request(gitlab_url) gitlab_request = urllib.request.Request(gitlab_url)
gitlab_request.add_header('PRIVATE-TOKEN' , sys.argv[4] ) gitlab_request.add_header('PRIVATE-TOKEN' , sys.argv[4] )
res = urllib.request.urlopen(gitlab_request, data=params.encode('ascii')) res = urllib.request.urlopen(gitlab_request, data=params.encode('ascii'))
......
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