blob: 93dfa34418c7a1cbac292de239270b0605f96d76 [file] [log] [blame]
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
substitutions:
"_TEST": "deprecate_test"
"_INPUT_IMAGE": "cos-dev-69-10895-0-0"
"_INPUT_PROJECT": "cos-cloud"
steps:
- name: 'gcr.io/cloud-builders/bazel'
args: ["run", "--spawn_strategy=standalone", ":cos_customizer", "--", "--norun"]
- name: 'gcr.io/cloud-builders/gcloud'
args: ["compute", "images", "create", "preload-test-$BUILD_ID-old",
"--source-image=${_INPUT_IMAGE}", "--source-image-project=${_INPUT_PROJECT}",
"--family=test-family"]
- name: 'bazel:cos_customizer'
args: ["start-image-build",
"-build-context=testing/${_TEST}",
"-image-name=${_INPUT_IMAGE}",
"-image-project=${_INPUT_PROJECT}",
"-gcs-bucket=${PROJECT_ID}_cloudbuild",
"-gcs-workdir=customizer-$BUILD_ID"]
- name: 'bazel:cos_customizer'
args: ["finish-image-build",
"-zone=us-west1-b",
"-project=$PROJECT_ID",
"-image-name=preload-test-$BUILD_ID",
"-image-family=test-family",
"-deprecate-old-images",
"-image-project=$PROJECT_ID"]
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: '/bin/bash'
env:
- "OLD_IMAGE=preload-test-$BUILD_ID-old"
- "IMAGE=preload-test-$BUILD_ID"
- "PROJECT=$PROJECT_ID"
args: ["/workspace/testing/${_TEST}/run_test.sh"]
options:
machineType: 'N1_HIGHCPU_8'
timeout: "7200s"