[infra] Work around Container Builder breakage.

This commit is contained in:
Oliver Chang 2017-04-12 22:39:55 -07:00
parent f8c5910e37
commit d269fb780e
2 changed files with 33 additions and 36 deletions

View File

@ -125,26 +125,32 @@ def get_build_steps(project_yaml, dockerfile_path):
ts = datetime.datetime.now().strftime('%Y%m%d%H%M') ts = datetime.datetime.now().strftime('%Y%m%d%H%M')
build_steps = [ build_steps = [
{ {
'name': 'gcr.io/cloud-builders/docker', 'args': [
'args': [ 'clone', 'https://github.com/google/oss-fuzz.git',
'build', ],
'-t', 'name': 'gcr.io/cloud-builders/git',
image, },
'.', {
], 'name': 'gcr.io/cloud-builders/docker',
'dir': 'projects/' + name, 'args': [
}, 'build',
{ '-t',
'name': image, image,
'args': [ '.',
'bash', ],
'-c', 'dir': 'oss-fuzz/projects/' + name,
'srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json' },
], {
'env': [ 'OSSFUZZ_REVISION=$REVISION_ID' ], 'name': image,
}, 'args': [
] 'bash',
'-c',
'srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json'
],
'env': [ 'OSSFUZZ_REVISION=$REVISION_ID' ],
},
]
for fuzzing_engine in project_yaml['fuzzing_engines']: for fuzzing_engine in project_yaml['fuzzing_engines']:
for sanitizer in get_sanitizers(project_yaml): for sanitizer in get_sanitizers(project_yaml):
@ -240,13 +246,6 @@ def main():
options = yaml.safe_load(os.environ["GCB_OPTIONS"]) options = yaml.safe_load(os.environ["GCB_OPTIONS"])
build_body = { build_body = {
'source': {
'repoSource': {
'branchName': 'master',
'projectId': 'oss-fuzz',
'repoName': 'oss-fuzz',
},
},
'steps': get_build_steps(project_yaml, dockerfile_path), 'steps': get_build_steps(project_yaml, dockerfile_path),
'timeout': str(4 * 3600) + 's', 'timeout': str(4 * 3600) + 's',
'options': options, 'options': options,

View File

@ -24,7 +24,12 @@ TAG_PREFIX = 'gcr.io/oss-fuzz-base/'
def get_steps(): def get_steps():
steps = [] steps = [{
'args': [
'clone', 'https://github.com/google/oss-fuzz.git',
],
'name': 'gcr.io/cloud-builders/git',
}]
for base_image in BASE_IMAGES: for base_image in BASE_IMAGES:
steps.append({ steps.append({
@ -34,7 +39,7 @@ def get_steps():
TAG_PREFIX + base_image, TAG_PREFIX + base_image,
'.', '.',
], ],
'dir': 'infra/base-images/' + base_image, 'dir': 'oss-fuzz/infra/base-images/' + base_image,
'name': 'gcr.io/cloud-builders/docker', 'name': 'gcr.io/cloud-builders/docker',
}) })
@ -47,13 +52,6 @@ def main():
options = yaml.safe_load(os.environ["GCB_OPTIONS"]) options = yaml.safe_load(os.environ["GCB_OPTIONS"])
build_body = { build_body = {
'source': {
'repoSource': {
'branchName': 'master',
'projectId': 'oss-fuzz-base',
'repoName': 'oss-fuzz',
},
},
'steps': get_steps(), 'steps': get_steps(),
'timeout': str(4 * 3600) + 's', 'timeout': str(4 * 3600) + 's',
'options': options, 'options': options,