concourse/tasks/generate-hash.yaml (14 lines of code) (raw):
---
platform: linux
image_resource:
type: registry-image
source:
repository: google/cloud-sdk
tag: alpine
outputs:
- name: generate-hash
run:
path: sh
args:
- -exc
- "gcloud storage cp ((gcsimgfile)) ((localfile)).tar.gz; if [ $? != 0 ]; then exit 1; fi; imghash=$(sha256sum ((localfile)).tar.gz | awk '{print $1;}'); echo $imghash | tee generate-hash/hash"