| 1 |
substitutions: |
| 2 |
'_IMAGE_NAME': '' |
| 3 |
'_IMAGE_PROJECT': '' |
| 4 |
'_CLEANUP': 'true' |
| 5 |
'_VM_NAME_PREFIX': 'oda-signedcontainer' |
| 6 |
'_ZONE': 'us-west1-a' |
| 7 |
# If the workload image changes, the commit author should change the cosign signature as well to not break tests. |
| 8 |
'_WORKLOAD_IMAGE': 'us-west1-docker.pkg.dev/confidential-space-images-dev/cs-integ-test-images/ipc/happypath@sha256:836d4ad39fa0fec5b386c4051a175036bd13d74a75d57933d30f6b804e509c8c' |
| 9 |
'_SIGNATURE_REPO': 'us-docker.pkg.dev/confidential-space-images-dev/cs-cosign-tests/oda' |
| 10 |
'_EXPECTED_SIG': 'MEUCIFoV6g8jU+EDQZJsySY5KcHYh/yRepxDFSUjhcJZ5du8AiEAooEHwjKsPIxO24NYE565E56DLU9H9vNX+jTP1nYwfNE=' |
| 11 |
|
| 12 |
steps: |
| 13 |
- name: 'gcr.io/cloud-builders/gcloud' |
| 14 |
id: CreateVM |
| 15 |
entrypoint: 'bash' |
| 16 |
env: |
| 17 |
- 'BUILD_ID=$BUILD_ID' |
| 18 |
args: ['create_vm.sh','-i', '${_IMAGE_NAME}', |
| 19 |
'-p', '${_IMAGE_PROJECT}', |
| 20 |
'-m', 'tee-image-reference=${_WORKLOAD_IMAGE},tee-container-log-redirect=true,tee-signed-image-repos=${_SIGNATURE_REPO},tee-env-ALLOWED_OVERRIDE=overridden,tee-cmd=["newCmd"]', |
| 21 |
'-n', '${_VM_NAME_PREFIX}-${BUILD_ID}', |
| 22 |
'-z', '${_ZONE}', |
| 23 |
] |
| 24 |
- name: 'gcr.io/cloud-builders/gcloud' |
| 25 |
id: TestCustomToken |
| 26 |
entrypoint: 'bash' |
| 27 |
args: ['scripts/test_custom_token.sh', "true", '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}'] |
| 28 |
- name: 'gcr.io/cloud-builders/gcloud' |
| 29 |
id: BasicDiscoverSignaturesTest |
| 30 |
entrypoint: 'bash' |
| 31 |
# Check how many times container image signatures is being logged. |
| 32 |
# Since signature logging will occur on refresh the default token, and on attest agent calling the `Attest` method, so the expected number should be 3. |
| 33 |
# This also checks the fetched signatures are the same. |
| 34 |
args: ['scripts/test_launcher_workload_discover_signatures.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}', '${_EXPECTED_SIG}', '3'] |
| 35 |
- name: 'gcr.io/cloud-builders/gcloud' |
| 36 |
id: CleanUp |
| 37 |
entrypoint: 'bash' |
| 38 |
env: |
| 39 |
- 'CLEANUP=$_CLEANUP' |
| 40 |
args: ['cleanup.sh', '${_VM_NAME_PREFIX}-${BUILD_ID}', '${_ZONE}'] |
| 41 |
# Must come after cleanup. |
| 42 |
- name: 'gcr.io/cloud-builders/gcloud' |
| 43 |
id: CheckFailure |
| 44 |
entrypoint: 'bash' |
| 45 |
env: |
| 46 |
- 'BUILD_ID=$BUILD_ID' |
| 47 |
args: ['check_failure.sh'] |
| 48 |
|
| 49 |
options: |
| 50 |
pool: |
| 51 |
name: 'projects/confidential-space-images-dev/locations/us-west1/workerPools/cs-image-build-vpc' |