File: //snap/google-cloud-cli/394/help/man/man1/gcloud_builds_triggers_create_webhook.1
.TH "GCLOUD_BUILDS_TRIGGERS_CREATE_WEBHOOK" 1
.SH "NAME"
.HP
gcloud builds triggers create webhook \- create a build trigger with a Webhook trigger event
.SH "SYNOPSIS"
.HP
\f5gcloud builds triggers create webhook\fR (\fB\-\-trigger\-config\fR=\fIPATH\fR\ |\ [\fB\-\-secret\fR=\fISECRET\fR\ (\fB\-\-build\-config\fR=\fIPATH\fR\ |\ \fB\-\-inline\-config\fR=\fIPATH\fR\ |\ [\fB\-\-dockerfile\fR=\fIDOCKERFILE\fR\ :\ \fB\-\-dockerfile\-dir\fR=\fIDOCKERFILE_DIR\fR;\ default="/"\ \fB\-\-dockerfile\-image\fR=\fIDOCKERFILE_IMAGE\fR])\ :\ \fB\-\-description\fR=\fIDESCRIPTION\fR\ \fB\-\-name\fR=\fINAME\fR\ \fB\-\-region\fR=\fIREGION\fR\ \fB\-\-[no\-]require\-approval\fR\ \fB\-\-service\-account\fR=\fISERVICE_ACCOUNT\fR\ \fB\-\-subscription\-filter\fR=\fISUBSCRIPTION_FILTER\fR\ \fB\-\-substitutions\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ \fB\-\-branch\fR=\fIBRANCH\fR\ |\ \fB\-\-tag\fR=\fITAG\fR\ \fB\-\-repository\fR=\fIREPOSITORY\fR\ |\ [\fB\-\-repo\fR=\fIREPO\fR\ \fB\-\-repo\-type\fR=\fIREPO_TYPE\fR\ :\ \fB\-\-github\-enterprise\-config\fR=\fIGITHUB_ENTERPRISE_CONFIG\fR]]) [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
Create a build trigger with a Webhook trigger event.
.SH "EXAMPLES"
To create a Webhook trigger that requires secret
\f5projects/my\-project/secrets/my\-secret/versions/2\fR and builds off branch
\f5my\-branch\fR in a GitHub repository named \f5my\-repo\fR:
.RS 2m
$ gcloud builds triggers create webhook \-\-name=my\-webhook\-trigger \e
\-\-service\-account="projects/my\-project/serviceAccounts/my\-byosa@\e
my\-project.iam.gserviceaccount.com" \e
\-\-secret=projects/my\-project/secrets/my\-secret/versions/2 \e
\-\-repo=https://www.github.com/owner/repo \-\-repo\-type=GITHUB \e
\-\-branch=my\-branch
.RE
To create a Webhook trigger that requires secret
\f5projects/my\-project/secrets/my\-secret/versions/2\fR and builds off branch
\f5my\-branch\fR in a 2nd\-gen GitHub repository:
.RS 2m
$ gcloud builds triggers create webhook \-\-name=my\-webhook\-trigger \e
\-\-service\-account="projects/my\-project/serviceAccounts/my\-byosa@\e
my\-project.iam.gserviceaccount.com" \e
\-\-secret=projects/my\-project/secrets/my\-secret/versions/2 \e
\-\-branch=my\-branch \e
\-\-repository=projects/my\-proj/locations/us\-west1/connections/\e
my\-conn/repositories/my\-repo
.RE
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
Exactly one of these must be specified:
.RS 2m
.TP 2m
\fB\-\-trigger\-config\fR=\fIPATH\fR
Path to Build Trigger config file (JSON or YAML format). For more details, see
https://cloud.google.com/cloud\-build/docs/api/reference/rest/v1/projects.triggers#BuildTrigger
.TP 2m
Flag based trigger configuration
.RS 2m
.TP 2m
\fB\-\-secret\fR=\fISECRET\fR
The full path of the secret version required to validate webhook requests
against this trigger. For example,
projects/my\-project/secrets/my\-secret/versions/1.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-description\fR=\fIDESCRIPTION\fR
Build trigger description.
.TP 2m
\fB\-\-name\fR=\fINAME\fR
Build trigger name.
.TP 2m
\fB\-\-region\fR=\fIREGION\fR
The region of the Cloud Build Service to use. Must be set to a supported region
name (e.g. \f5us\-central1\fR). If unset, \f5builds/region\fR, which is the
default region to use when working with Cloud Build resources, is used. If
builds/region is unset, region is set to \f5global\fR. Note: Region must be
specified in 2nd gen repo; \f5global\fR is not supported.
.TP 2m
\fB\-\-[no\-]require\-approval\fR
Require manual approval for triggered builds. Use \fB\-\-require\-approval\fR to
enable and \fB\-\-no\-require\-approval\fR to disable.
.TP 2m
\fB\-\-service\-account\fR=\fISERVICE_ACCOUNT\fR
The service account used for all user\-controlled operations including
UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. If no service
account is set, then the standard Cloud Build service account
([PROJECT_NUM]@system.gserviceaccount.com) is used instead. Format:
\f5projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}\fR.
.TP 2m
\fB\-\-subscription\-filter\fR=\fISUBSCRIPTION_FILTER\fR
CEL filter expression for the trigger. See
https://cloud.google.com/build/docs/filter\-build\-events\-using\-cel for more
details.
.TP 2m
\fB\-\-substitutions\fR=[\fIKEY\fR=\fIVALUE\fR,...]
Parameters to be substituted in the build specification. For example:
.RS 2m
$ gcloud builds triggers create webhook ... \e
\-\-substitutions _FAVORITE_COLOR=blue,_NUM_CANDIES=10
.RE
This will result in a build where every occurrence of \f5${_FAVORITE_COLOR}\fR
in certain fields is replaced by "blue", and similarly for \f5${_NUM_CANDIES}\fR
and "10".
Substitutions can be applied to user\-defined variables (starting with an
underscore) and to the following built\-in variables: REPO_NAME, BRANCH_NAME,
TAG_NAME, REVISION_ID, COMMIT_SHA, SHORT_SHA.
For more details, see:
https://cloud.google.com/build/docs/configuring\-builds/substitute\-variable\-values
.TP 2m
Exactly one of these must be specified:
.RS 2m
.TP 2m
\fB\-\-build\-config\fR=\fIPATH\fR
Path to a YAML or JSON file containing the build configuration in the
repository.
For more details, see: https://cloud.google.com/cloud\-build/docs/build\-config
.TP 2m
\fB\-\-inline\-config\fR=\fIPATH\fR
Local path to a YAML or JSON file containing a build configuration.
.TP 2m
Dockerfile build configuration flags
.RS 2m
.TP 2m
\fB\-\-dockerfile\fR=\fIDOCKERFILE\fR
Path of Dockerfile to use for builds in the repository.
If specified, a build config will be generated to run docker build using the
specified file.
The filename is relative to the Dockerfile directory.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-dockerfile\-dir\fR=\fIDOCKERFILE_DIR\fR; default="/"
Location of the directory containing the Dockerfile in the repository.
The directory will also be used as the Docker build context.
.TP 2m
\fB\-\-dockerfile\-image\fR=\fIDOCKERFILE_IMAGE\fR
Docker image name to build.
If not specified, gcr.io/PROJECT/github.com/REPO_OWNER/REPO_NAME:$COMMIT_SHA
will be used.
Use a build configuration (cloudbuild.yaml) file for building multiple images in
a single trigger.
.RE
.RE
.sp
.TP 2m
Flags for repository and branch information
.RS 2m
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-branch\fR=\fIBRANCH\fR
Branch to build.
.TP 2m
\fB\-\-tag\fR=\fITAG\fR
Tag to build.
.RE
.sp
.TP 2m
Flags for repository information
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-repository\fR=\fIREPOSITORY\fR
Repository resource (2nd gen) to use, in the format
"projects/*/locations/*/connections/*/repositories/\fB".
.TP 2m
1st\-gen repository settings.
.RS 2m
.TP 2m
\fR\-\-repo\fB=\fIREPO\fR
URI of the repository (1st gen). Currently only HTTP URIs for GitHub and Cloud
Source Repositories are supported.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fR\-\-repo\-type\fB=\fIREPO_TYPE\fR
Type of the repository (1st gen). Currently only GitHub and Cloud Source
Repository types are supported.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fR\-\-github\-enterprise\-config\fB=\fIGITHUB_ENTERPRISE_CONFIG\fR
The resource name of the GitHub Enterprise config that should be applied to this
source (1st gen). Format:
projects/{project}/locations/{location}/githubEnterpriseConfigs/{id} or
projects/{project}/githubEnterpriseConfigs/{id}
\fR
.RE
.RE
.RE
.RE
.RE
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "NOTES"
These variants are also available:
.RS 2m
$ gcloud alpha builds triggers create webhook
.RE
.RS 2m
$ gcloud beta builds triggers create webhook
.RE