From 875e1137a66ac0c83545cfb72900a454ffe0df0a Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 5 Jun 2017 16:05:26 -0700 Subject: [PATCH] Build the debian package builder image as part of the cloudbuild. (#306) Skip tagging the builder image as it's not needed by anything else except this pipeline. --- deb-package-builder/build-packages.yaml | 4 +++- deb-package-builder/build_packages.sh | 11 +---------- deb-package-builder/builder.yaml | 6 ------ 3 files changed, 4 insertions(+), 17 deletions(-) delete mode 100644 deb-package-builder/builder.yaml diff --git a/deb-package-builder/build-packages.yaml b/deb-package-builder/build-packages.yaml index e8c99c83..b551ecbe 100644 --- a/deb-package-builder/build-packages.yaml +++ b/deb-package-builder/build-packages.yaml @@ -1,7 +1,9 @@ steps: + - name: gcr.io/cloud-builders/docker + args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/deb-package-builder', '.'] - name: gcr.io/cloud-builders/gsutil args: ['-m', 'rsync', 'gs://${_BUCKET}/packages/${_PHP_VERSION}/', '/workspace/pkg/'] - - name: ${_IMAGE} + - name: gcr.io/${_GOOGLE_PROJECT_ID}/deb-package-builder args: ['${_PHP_VERSION}'] - name: gcr.io/cloud-builders/gsutil args: ['-m', 'rsync', '/workspace/pkg/', 'gs://${_BUCKET}/packages/${_PHP_VERSION}/'] diff --git a/deb-package-builder/build_packages.sh b/deb-package-builder/build_packages.sh index 2529fc80..abc92823 100755 --- a/deb-package-builder/build_packages.sh +++ b/deb-package-builder/build_packages.sh @@ -30,20 +30,11 @@ if [ -z "${BUCKET}" ]; then echo "Defaulting Bucket to: ${BUCKET}" fi -IMAGE="gcr.io/${GOOGLE_PROJECT_ID}/deb-package-builder" - -# First, build the package builder -if [ -z "${USE_LATEST}" ]; then - echo "Building package builder..." - gcloud container builds submit . --config=builder.yaml \ - --substitutions _IMAGE=${IMAGE} -fi - # Use the package builder for VERSION in $(echo ${PHP_VERSIONS} | tr "," "\n") do echo "Building packages for PHP ${VERSION}" gcloud container builds submit . --config=build-packages.yaml \ - --substitutions _PHP_VERSION=${VERSION},_IMAGE=${IMAGE},_BUCKET=${BUCKET} \ + --substitutions _PHP_VERSION=${VERSION},_GOOGLE_PROJECT_ID=${GOOGLE_PROJECT_ID},_BUCKET=${BUCKET} \ --timeout=40m done diff --git a/deb-package-builder/builder.yaml b/deb-package-builder/builder.yaml deleted file mode 100644 index 5d03331f..00000000 --- a/deb-package-builder/builder.yaml +++ /dev/null @@ -1,6 +0,0 @@ -steps: - - name: gcr.io/cloud-builders/docker - args: ['build', '-t', '${_IMAGE}', '.'] - -images: - - ${_IMAGE}