substitutions: # Expects hardened image (not debug) and should have startup-script service # disabled. google-startup-scripts.service is only enabled with multi-user.target. '_IMAGE_NAME': '' '_IMAGE_PROJECT': '' # Add user-data in the metadata to test if it is disabled. '_METADATA_FILE': 'startup-script=data/echo_startupscript.sh,user-data=data/cloud-init-config.yaml' '_CLEANUP': 'true' '_VM_NAME_PREFIX': 'cs-hardened-test' '_ZONE': 'us-west1-a' '_CC': '' '_WORKLOAD_IMAGE': 'us-west1-docker.pkg.dev/confidential-space-images-dev/cs-integ-test-images/basic-test:latest' steps: - name: 'gcr.io/cloud-builders/gcloud' id: CreateVM entrypoint: 'bash' env: - 'BUILD_ID=$BUILD_ID' args: ['create_vm.sh','-i', '${_IMAGE_NAME}', '-p', '${_IMAGE_PROJECT}', '-f', '${_METADATA_FILE}', '-m', 'tee-image-reference=${_WORKLOAD_IMAGE},tee-container-log-redirect=true,tee-cmd=["newCmd"],tee-env-ALLOWED_OVERRIDE=overridden', '-n', '${_VM_NAME_PREFIX}-${BUILD_ID}', '-z', '${_ZONE}', '-c', '${_CC}', ] - name: 'gcr.io/cloud-builders/gcloud' id: BasicWorkloadTest entrypoint: 'bash' args: ['scripts/test_launcher_workload.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}'] - name: 'gcr.io/cloud-builders/gcloud' id: BasicWorkloadTestCloudLogging entrypoint: 'bash' env: - 'PROJECT_ID=$PROJECT_ID' args: ['scripts/test_launcher_workload_cloudlogging.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}'] - name: 'gcr.io/cloud-builders/gcloud' id: ChangeMDSVariables entrypoint: 'bash' args: ['util/change_metadata_vars.sh', '-n', '${_VM_NAME_PREFIX}-${BUILD_ID}', '-z', '${_ZONE}', '-m', 'tee-image-reference=gcr.io/cloudrun/hello:latest', ] - name: 'gcr.io/cloud-builders/gcloud' id: ChangeMDSVariablesTest entrypoint: 'bash' args: ['scripts/test_mds_var_change.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}'] - name: 'gcr.io/cloud-builders/gcloud' id: MultiWriterPDTest entrypoint: 'bash' env: - 'BUILD_ID=$BUILD_ID' args: ['scripts/test_multiwriterpd_disabled.sh'] - name: 'gcr.io/cloud-builders/gcloud' id: StartupScriptDisabledTest entrypoint: 'bash' args: ['scripts/test_startupscript_disabled.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}'] - name: 'gcr.io/cloud-builders/gcloud' id: CloudInitUserDataDisabledTest entrypoint: 'bash' args: ['scripts/test_cloud_init_userdata_disabled.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}'] - name: 'gcr.io/cloud-builders/gcloud' id: CleanUp entrypoint: 'bash' env: - 'CLEANUP=$_CLEANUP' args: ['cleanup.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}'] # Must come after cleanup. - name: 'gcr.io/cloud-builders/gcloud' id: CheckFailure entrypoint: 'bash' env: - 'BUILD_ID=$BUILD_ID' args: ['check_failure.sh'] options: pool: name: 'projects/confidential-space-images-dev/locations/us-west1/workerPools/cs-image-build-vpc'