curl/cloudbuild.yaml (14 lines of code) (raw):
steps:
- name: gcr.io/cloud-builders/docker
args:
- 'build'
- '--tag=gcr.io/$PROJECT_ID/curl'
- '.'
# Print version information.
- name: gcr.io/$PROJECT_ID/curl
args: ['-V']
# GET data from a server, specifying an Authorization header.
- name: gcr.io/$PROJECT_ID/curl
args: ['-o', 'file.out', "--header", "Authorization: Bearer foobar'", 'https://www.example.com']
# POST information to a server, specifying a Content-type header.
- name: gcr.io/$PROJECT_ID/curl
args: ['--header', 'Content-type: application/json"', '--data', '"{\"buildID\": \"$BUILD_ID\"}"', 'https://www.example.com']
images:
- 'gcr.io/$PROJECT_ID/curl'