Search code examples
google-cloud-platformbuildgcloudgoogle-cloud-buildbuild-triggers

GCP CloudBuild -> Failed to trigger build: unrecognized arguments


I want to run a trigger by passing some substitution values by using gcloud command. Here is my command:

gcloud beta builds triggers run my-service --branch=test-deploy-of-history --project=dev-project --substitutions=_SERVICE_NAME=flow

After entering the command, I am getting this error message:

ERROR: (gcloud.beta.builds.triggers.run) unrecognized arguments: --substitutions=_SERVICE_NAME=flow

Is there any way to pass substitutions values while using this command ?


Solution

  • As of version 433.0.0 of the Google Cloud SDK (released on May 31, 2023), there have been some breaking changes to the gcloud beta builds triggers run command.Refer to this documentation for more information

    Cloud Build

    • Added flag to specify substitutions in gcloud builds triggers run.
    • Modified --branch, --tag, --sha flags to be optional in gcloud builds triggers run command.

    You can try updating the beta component; it will update all of your installed components to the latest version.you can refer to this document

    gcloud components update