Added parent hook and some renderer #1
|
@ -5,7 +5,7 @@ import re
|
|||
@util.renderer
|
||||
def is_build_script_available(props):
|
||||
# Actual check will got here
|
||||
return props.getProperty("jobname", default="") != ""
|
||||
return props.getProperty("build_available", default=False)
|
||||
|
||||
|
||||
@util.renderer
|
||||
|
@ -16,7 +16,7 @@ def isnt_build_script_available(props):
|
|||
@util.renderer
|
||||
def is_test_script_available(props):
|
||||
# Actual check will got here
|
||||
return props.getProperty("jobname", default="") != ""
|
||||
return props.getProperty("test_available", default=False)
|
||||
|
||||
|
||||
@util.renderer
|
||||
|
|
|
@ -107,7 +107,7 @@ def get_dockerfile_contents(path, os_codename):
|
|||
}[os_codename]
|
||||
|
||||
|
||||
def trigger_child_hooks(buildbotUrl: str, os_codename: str, directory=".buildbot"):
|
||||
def trigger_child_hooks(buildbotUrl: str, os_codename: str, repository, branch, jobname, directory=".buildbot"):
|
||||
request_url = buildbotUrl + ty
|
||||
|
||||
# List all jobs in the directory
|
||||
|
@ -129,6 +129,9 @@ def trigger_child_hooks(buildbotUrl: str, os_codename: str, directory=".buildbot
|
|||
),
|
||||
"build_script_available": is_build_script_available(build_script_exists),
|
||||
"test_script_available": is_test_script_available(test_script_exists),
|
||||
"repository": repository,
|
||||
|
||||
"branch": branch,
|
||||
"jobname": jobname,
|
||||
}
|
||||
requests.post(request_url, headers=request_headers, data=request_data)
|
||||
|
||||
|
@ -200,12 +203,7 @@ if __name__ == "__main__":
|
|||
buildbotUrl = sys.argv[4]
|
||||
os_codename = sys.argv[5]
|
||||
|
||||
# add these into the request_data
|
||||
request_data["jobname"] = jobname
|
||||
request_data["repository"] = repository
|
||||
request_data["branch"] = branch
|
||||
|
||||
trigger_child_hooks(buildbotUrl, os_codename)
|
||||
trigger_child_hooks(buildbotUrl, os_codename, repository, branch, jobname)
|
||||
else:
|
||||
print(
|
||||
"Usage: python3 multibuild.py <jobname> <repository> <branch> <buildbotUrl> <os_codename>"
|
||||
|
|
Loading…
Reference in New Issue
Block a user
I think
repository
andbranch
are a level higher.