Skip to content

Commit

Permalink
gcb: fix docker image reference and escaping
Browse files Browse the repository at this point in the history
Signed-off-by: Asra Ali <[email protected]>
  • Loading branch information
asraa committed Sep 19, 2022
1 parent 03f788e commit 9e498d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ env:
ISSUE_REPOSITORY: slsa-framework/slsa-github-generator

IMAGE_REGISTRY: us-west2-docker.pkg.dev
IMAGE_PROJECT: slsa-tooling
IMAGE_NAME: example-package-repo/e2e-gcb-workflow_dispatch-main-cloudbuild-slsa3
IMAGE_NAME: slsa-tooling/example-package-repo/example-package-repo/e2e-gcb-workflow_dispatch-main-cloudbuild-slsa3

jobs:
dispatch:
Expand Down Expand Up @@ -65,4 +64,4 @@ jobs:
echo "Retrieved image digest ${IMAGE_DIGEST}..."
export ESCAPED_IMAGE_NAME=$(echo $IMAGE_NAME | sed "s/\//%2F/g")
gcloud artifacts docker images describe "${IMAGE_REGISTRY}"/${IMAGE_PROJECT}/"${ESCAPED_IMAGE_NAME}@${IMAGE_DIGEST}" --verbosity debug --show-provenance
gcloud artifacts docker images describe "${IMAGE_REGISTRY}"/"${ESCAPED_IMAGE_NAME}@${IMAGE_DIGEST}" --verbosity debug --show-provenance
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ env:
ISSUE_REPOSITORY: slsa-framework/slsa-github-generator

IMAGE_REGISTRY: us-west2-docker.pkg.dev
IMAGE_PROJECT: slsa-tooling
IMAGE_NAME: example-package-repo/e2e-gcb-workflow_dispatch-main-dockerfile-slsa3
IMAGE_NAME: slsa-tooling/example-package-repo/e2e-gcb-workflow_dispatch-main-dockerfile-slsa3

jobs:
dispatch:
Expand Down Expand Up @@ -66,4 +65,4 @@ jobs:
echo "Retrieved image digest ${IMAGE_DIGEST}..."
export ESCAPED_IMAGE_NAME=$(echo $IMAGE_NAME | sed "s/\//%2F/g")
gcloud artifacts docker images describe "${IMAGE_REGISTRY}"/${IMAGE_PROJECT}/"${ESCAPED_IMAGE_NAME}@${IMAGE_DIGEST}" --verbosity debug --show-provenance
gcloud artifacts docker images describe "${IMAGE_REGISTRY}"/"${ESCAPED_IMAGE_NAME}@${IMAGE_DIGEST}" --verbosity debug --show-provenance
4 changes: 2 additions & 2 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'us-west2-docker.pkg.dev/slsa-tooling/example-package-repo/${_IMAGE_NAME}', '.']
images: ['us-west2-docker.pkg.dev/slsa-tooling/example-package-repo/${_IMAGE_NAME}']
args: ['build', '-t', 'us-west2-docker.pkg.dev/${_IMAGE_NAME}', '.']
images: ['us-west2-docker.pkg.dev/${_IMAGE_NAME}']
options:
requestedVerifyOption: 'VERIFIED'
sourceProvenanceHash: ['SHA256']
Expand Down

0 comments on commit 9e498d9

Please sign in to comment.