Added parent hook and some renderer #1

Merged
PeterSurda merged 7 commits from Ss_singh/buildbot_multibuild:hooks into master 2021-12-26 08:05:49 +00:00
2 changed files with 7 additions and 9 deletions
Showing only changes of commit c9d1ffa117 - Show all commits

View File

@ -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)

should check for the correct property

should check for the correct property
@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)

should also check the correct property

should also check the correct property
@util.renderer

View File

@ -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,
Review

I think repository and branch are a level higher.

I think `repository` and `branch` are a level higher.
"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>"