| # Copyright 2020 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: | |
| '_ZONE': 'us-west1-b' | |
| '_TEST': 'seal_oem_test' | |
| '_INPUT_IMAGE': 'cos-81-12871-148-0' | |
| '_INPUT_PROJECT': 'cos-cloud' | |
| '_SERVICE_ACCOUNT': 'compute@cloud-image-docker-builder.google.com.iam.gserviceaccount.com' | |
| '_COS_CUSTOMIZER': 'cos_customizer' | |
| steps: | |
| - name: 'gcr.io/cloud-builders/docker' | |
| entrypoint: '/bin/bash' | |
| args: | |
| - '-c' | |
| - | | |
| if [[ ${_COS_CUSTOMIZER} == 'cos_customizer' ]]; then | |
| docker build -f src/cmd/cos_customizer/Dockerfile -t cos_customizer . | |
| fi | |
| - name: '${_COS_CUSTOMIZER}' | |
| args: ['start-image-build', | |
| '-build-context=testing/${_TEST}', | |
| '-image-name=${_INPUT_IMAGE}', | |
| '-image-project=${_INPUT_PROJECT}', | |
| '-gcs-bucket=${_PROJECT_NAME}_cloudbuild', | |
| '-gcs-workdir=customizer-$BUILD_ID'] | |
| - name: '${_COS_CUSTOMIZER}' | |
| args: ['run-script', | |
| '-script=preload.sh'] | |
| - name: '${_COS_CUSTOMIZER}' | |
| args: ['seal-oem'] | |
| - name: '${_COS_CUSTOMIZER}' | |
| args: ['run-script', | |
| '-script=modify_oem.sh'] | |
| - name: '${_COS_CUSTOMIZER}' | |
| args: ['finish-image-build', | |
| '-zone=${_ZONE}', | |
| '-project=$PROJECT_ID', | |
| '-image-name=preload-test-$BUILD_ID', | |
| '-image-project=$PROJECT_ID', | |
| '-service-account=${_SERVICE_ACCOUNT}', | |
| '-disk-size-gb=11'] | |
| - name: 'gcr.io/cloud-builders/docker' | |
| args: [ 'build', '-t', 'seal-oem-test-timeout-image', 'testing/${_TEST}' ] | |
| - name: 'seal-oem-test-timeout-image' | |
| entrypoint: '/bin/bash' | |
| args: | |
| - '-c' | |
| - | | |
| /daisy -default_timeout=5m -project=$PROJECT_ID -zone=${_ZONE} \ | |
| -var:image_name preload-test-$BUILD_ID -var:image_project $PROJECT_ID \ | |
| -var:daisy_gcs_bucket $_PROJECT_NAME-daisy-bkt -var:test_cfg /preload_test.cfg \ | |
| /run_test.wf.json | tee /build.log | |
| if ( grep "did not complete within the specified timeout" /build.log > /dev/null ); \ | |
| then exit 0; else echo "error: timemout expected"; exit 1; fi | |
| options: | |
| machineType: 'N1_HIGHCPU_32' | |
| timeout: '7200s' |