0

I have a GCP Cloub build configuration, where a bash script is needed to be executed.

The below configuration works just fine.

steps:
  - name: 'gcr.io/cloud-builders/gcloud'
    entrypoint: 'bash'
    args: ['./my_script.sh']

But, I want to be able to pass the Build_ID as an argument to the bash script. e.g.:

steps:
  - name: 'gcr.io/cloud-builders/gcloud'
    entrypoint: 'bash'
    args: ['./my_script.sh ${BUILD_ID}']

This doesn't work, unfortunately.

I get an error such as: bash: ./my_script.sh 204792d1-6336-489b-ba20-fbce7401a40b: No such file or directory

Any help on this is highly appreciated.

user1502505
  • 724
  • 1
  • 8
  • 11

1 Answers1

3

Try to parametrize arguments, with:

steps:
  - name: 'gcr.io/cloud-builders/gcloud'
    entrypoint: 'bash'
    args: ['./my_script.sh', '${BUILD_ID}']
Gonzalo
  • 353
  • 2
  • 16