diff --git a/concourse/pipelines/windows-image-build-mbr.jsonnet b/concourse/pipelines/windows-image-build-mbr.jsonnet index f3954ce74..f9e3d1c0c 100644 --- a/concourse/pipelines/windows-image-build-mbr.jsonnet +++ b/concourse/pipelines/windows-image-build-mbr.jsonnet @@ -7,6 +7,29 @@ local gcp_secret_manager = import '../templates/gcp-secret-manager.libsonnet'; local envs = ['testing']; local underscore(input) = std.strReplace(input, '-', '_'); +local imagetesttask = { + local task = self, + + images:: error 'must set images in imagetesttask', + + // Start of task + platform: 'windows', + image_resource: { + type: 'registry-image', + source: { repository: 'gcr.io/compute-image-tools/cloud-image-tests' }, + }, + run: { + path: '/manager', + args: [ + '-project=gcp-guest', + '-zone=us-central1-a', + '-test_projects=compute-image-test-pool-002,compute-image-test-pool-003,compute-image-test-pool-004,compute-image-test-pool-005', + '-exclude=(oslogin)|(storageperf)|(networkperf)|(shapevalidation)', + '-images=' + task.images, + ] + }, +}; + // Templates. local imgbuildjob = { local job = self, @@ -156,6 +179,7 @@ local imgpublishjob = { gcs:: 'gs://%s/%s' % [self.gcs_bucket, self.gcs_dir], gcs_bucket:: common.prod_bucket, topic:: common.prod_topic, + image_prefix:: self.image, // Publish can proceed if build passes. passed:: if job.env == 'testing' then @@ -166,6 +190,9 @@ local imgpublishjob = { // Builds are automatically pushed to testing. trigger:: if job.env == 'testing' then true else false, + + runtests:: if job.env == 'testing' then true + else false, // Start of job. name: 'publish-to-%s-%s' % [job.env, job.image], @@ -204,11 +231,22 @@ local imgpublishjob = { source_gcs_path: job.gcs, source_version: 'v((.:source-version))', publish_version: '((.:publish-version))', - wf: job.workflow, - environment: if job.env == 'testing' then 'test' else job.env, + wf: job.workflow, + environment: if job.env == 'testing' then 'test' else job.env, }, }, - ], + ] + + if job.runtests then + [ + { + task: 'image-test-' + job.image, + config: imagetesttask { + images: 'projects/bct-prod-images/global/images/%s-((.:publish-version))' % job.image_prefix, + }, + attempts: 3, + }, + ] + else [], }; local ImgBuildJob(image, iso_secret, updates_secret) = imgbuildjob { @@ -223,7 +261,7 @@ local ImgPublishJob(image, env, workflow_dir, gcs_dir) = imgpublishjob { env: env, gcs_dir: gcs_dir, passed:: 'build-' + image, - workflow: '%s/%s' % [workflow_dir, image + '-bios.publish.json'], + workflow: '%s/%s' % [workflow_dir, image + '.publish.json'], }; local ImgGroup(name, images, environments) = {