Commit 2d907171 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

CI: fix typos, handle missing build id

No related merge requests found
Showing with 10 additions and 7 deletions
+10 -7
...@@ -168,7 +168,7 @@ class Handler: ...@@ -168,7 +168,7 @@ class Handler:
if key == "project": if key == "project":
project = value project = value
if ( site == "" or stamp == "" or name == "" or project == ""): if ( site == "" or stamp == "" or name == "" or project == ""):
print( "Not enougth argument given for buildid request \ print( "Missing argument for buildid request \
site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".") site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".")
return return
buildid_api = "/api/v1/getbuildid.php?" buildid_api = "/api/v1/getbuildid.php?"
...@@ -198,7 +198,7 @@ site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".") ...@@ -198,7 +198,7 @@ site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".")
if ( buildid == "" ): if ( buildid == "" ):
buildid = self.buildid buildid = self.buildid
if ( buildid == "" ): if ( buildid == "" ):
print( "Not enougth argument given to build url") print( "Missing argument to build url")
return return
build_url = self.url build_url = self.url
build_url +="/buildSummary.php?" build_url +="/buildSummary.php?"
...@@ -212,7 +212,7 @@ site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".") ...@@ -212,7 +212,7 @@ site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".")
if ( buildid == "" ): if ( buildid == "" ):
buildid = self.buildid buildid = self.buildid
if ( buildid == "" ): if ( buildid == "" ):
print( "Not enougth argument given to build Status") print( "Missing argument to build Status")
return return
full_url = self.url + "/api/v1/buildSummary.php?buildid=" + buildid full_url = self.url + "/api/v1/buildSummary.php?buildid=" + buildid
response = urllib.request.urlopen(full_url).read().decode() response = urllib.request.urlopen(full_url).read().decode()
...@@ -251,10 +251,13 @@ if __name__ == "__main__": ...@@ -251,10 +251,13 @@ if __name__ == "__main__":
handler.GetSite() handler.GetSite()
handler.GetName() handler.GetName()
handler.GetStamp() handler.GetStamp()
handler.GetBuildId() if handler.GetBuildId() is None:
# handler.buildid="1" cdash_url = "https://cdash.orfeo-toolbox.org"
cdash_url = handler.GetBuildUrl() state = 'failed'
( state , error ) = handler.GetBuildStatus() error = "Failed to get build id"
else:
cdash_url = handler.GetBuildUrl()
( state , error ) = handler.GetBuildStatus()
if trace: if trace:
print ( "cdash_url is: " + cdash_url ) print ( "cdash_url is: " + cdash_url )
gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/" gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/"
......
Supports Markdown
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