From d269fb780e5672eeda6707442fb8a3c075795f7c Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Wed, 12 Apr 2017 22:39:55 -0700 Subject: [PATCH] [infra] Work around Container Builder breakage. --- infra/gcb/build.py | 53 +++++++++++++++++----------------- infra/gcb/build_base_images.py | 16 +++++----- 2 files changed, 33 insertions(+), 36 deletions(-) diff --git a/infra/gcb/build.py b/infra/gcb/build.py index 9c2ce6469..f0d38a552 100755 --- a/infra/gcb/build.py +++ b/infra/gcb/build.py @@ -125,26 +125,32 @@ def get_build_steps(project_yaml, dockerfile_path): ts = datetime.datetime.now().strftime('%Y%m%d%H%M') build_steps = [ - { - 'name': 'gcr.io/cloud-builders/docker', - 'args': [ - 'build', - '-t', - image, - '.', - ], - 'dir': 'projects/' + name, - }, - { - 'name': image, - 'args': [ - 'bash', - '-c', - 'srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json' - ], - 'env': [ 'OSSFUZZ_REVISION=$REVISION_ID' ], - }, - ] + { + 'args': [ + 'clone', 'https://github.com/google/oss-fuzz.git', + ], + 'name': 'gcr.io/cloud-builders/git', + }, + { + 'name': 'gcr.io/cloud-builders/docker', + 'args': [ + 'build', + '-t', + image, + '.', + ], + 'dir': 'oss-fuzz/projects/' + name, + }, + { + '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 sanitizer in get_sanitizers(project_yaml): @@ -240,13 +246,6 @@ def main(): options = yaml.safe_load(os.environ["GCB_OPTIONS"]) build_body = { - 'source': { - 'repoSource': { - 'branchName': 'master', - 'projectId': 'oss-fuzz', - 'repoName': 'oss-fuzz', - }, - }, 'steps': get_build_steps(project_yaml, dockerfile_path), 'timeout': str(4 * 3600) + 's', 'options': options, diff --git a/infra/gcb/build_base_images.py b/infra/gcb/build_base_images.py index a98edce99..54d02cf62 100755 --- a/infra/gcb/build_base_images.py +++ b/infra/gcb/build_base_images.py @@ -24,7 +24,12 @@ TAG_PREFIX = 'gcr.io/oss-fuzz-base/' 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: steps.append({ @@ -34,7 +39,7 @@ def get_steps(): TAG_PREFIX + base_image, '.', ], - 'dir': 'infra/base-images/' + base_image, + 'dir': 'oss-fuzz/infra/base-images/' + base_image, 'name': 'gcr.io/cloud-builders/docker', }) @@ -47,13 +52,6 @@ def main(): options = yaml.safe_load(os.environ["GCB_OPTIONS"]) build_body = { - 'source': { - 'repoSource': { - 'branchName': 'master', - 'projectId': 'oss-fuzz-base', - 'repoName': 'oss-fuzz', - }, - }, 'steps': get_steps(), 'timeout': str(4 * 3600) + 's', 'options': options,