almost all PR discussion fixes
This commit is contained in:
parent
d25cc4db9c
commit
02498d72ba
13 changed files with 200 additions and 148 deletions
|
@ -93,10 +93,6 @@ class BuildComponent(BaseComponent):
|
|||
self._build_failure('Could not load build job information', irbe)
|
||||
|
||||
base_image_information = {}
|
||||
buildpack_url = ""
|
||||
if build_job.repo_build.resource_key is not None:
|
||||
buildpack_url = self.user_files.get_file_url(build_job.repo_build.resource_key,
|
||||
requires_cors=False)
|
||||
|
||||
# Add the pull robot information, if any.
|
||||
if build_job.pull_credentials:
|
||||
|
@ -109,6 +105,7 @@ class BuildComponent(BaseComponent):
|
|||
|
||||
# Parse the build queue item into build arguments.
|
||||
# build_package: URL to the build package to download and untar/unzip.
|
||||
# defaults to empty string to avoid requiring a pointer on the builder.
|
||||
# sub_directory: The location within the build package of the Dockerfile and the build context.
|
||||
# repository: The repository for which this build is occurring.
|
||||
# registry: The registry for which this build is occuring (e.g. 'quay.io', 'staging.quay.io').
|
||||
|
@ -121,14 +118,16 @@ class BuildComponent(BaseComponent):
|
|||
# username: The username for pulling the base image (if any).
|
||||
# password: The password for pulling the base image (if any).
|
||||
build_arguments = {
|
||||
'build_package': buildpack_url,
|
||||
'sub_directory': build_config.get('build_subdir', ''),
|
||||
'repository': repository_name,
|
||||
'registry': self.registry_hostname,
|
||||
'pull_token': build_job.repo_build.access_token.code,
|
||||
'push_token': build_job.repo_build.access_token.code,
|
||||
'tag_names': build_config.get('docker_tags', ['latest']),
|
||||
'base_image': base_image_information,
|
||||
'build_package': self.user_files.get_file_url(build_job.repo_build.resource_key,
|
||||
requires_cors=False)
|
||||
if build_job.repo_build.resource_key is not None else "",
|
||||
'sub_directory': build_config.get('build_subdir', ''),
|
||||
'repository': repository_name,
|
||||
'registry': self.registry_hostname,
|
||||
'pull_token': build_job.repo_build.access_token.code,
|
||||
'push_token': build_job.repo_build.access_token.code,
|
||||
'tag_names': build_config.get('docker_tags', ['latest']),
|
||||
'base_image': base_image_information,
|
||||
}
|
||||
|
||||
# If the trigger has a private key, it's using git, thus we should add
|
||||
|
@ -138,8 +137,8 @@ class BuildComponent(BaseComponent):
|
|||
# private_key: the key used to get read access to the git repository
|
||||
if build_job.repo_build.trigger.private_key is not None:
|
||||
build_arguments['git'] = {
|
||||
'url': build_config['trigger_metadata']['git_url'],
|
||||
'sha': build_config['trigger_metadata']['commit_sha'],
|
||||
'url': build_config['trigger_metadata'].get('git_url', ''),
|
||||
'sha': build_config['trigger_metadata'].get('commit_sha', ''),
|
||||
'private_key': build_job.repo_build.trigger.private_key,
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue