File: //snap/google-cloud-cli/current/help/man/man1/gcloud_alpha_builds_connections_create_gitlab.1
.TH "GCLOUD_ALPHA_BUILDS_CONNECTIONS_CREATE_GITLAB" 1
.SH "NAME"
.HP
gcloud alpha builds connections create gitlab \- create a Cloud Build Connection for gitlab.com or GitLab Enterprise
.SH "SYNOPSIS"
.HP
\f5gcloud alpha builds connections create gitlab\fR (\fICONNECTION\fR\ :\ \fB\-\-region\fR=\fIREGION\fR) \fB\-\-authorizer\-token\-secret\-version\fR=\fIAUTHORIZER_TOKEN_SECRET_VERSION\fR \fB\-\-read\-authorizer\-token\-secret\-version\fR=\fIREAD_AUTHORIZER_TOKEN_SECRET_VERSION\fR \fB\-\-webhook\-secret\-secret\-version\fR=\fIWEBHOOK_SECRET_SECRET_VERSION\fR [\fB\-\-async\fR] [\fB\-\-host\-uri\fR=\fIHOST_URI\fR] [\fB\-\-service\-directory\-service\fR=\fISERVICE_DIRECTORY_SERVICE\fR\ :\ \fB\-\-ssl\-ca\-file\fR=\fISSL_CA_FILE\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Create a Cloud Build Connection for gitlab.com or GitLab
Enterprise.
A gitlab.com or GitLab Enterprise Connection can be created by using a personal
access token with \f5api\fR scope permission. A \f5read_repository\fR scoped
personal access token will also be required on gitlab.com or if the self\-hosted
GitLab server doesn't support project access token (GitLab Enterprise server
version < 13.10).
If the GitLab Enterprise server can only be accessed within a VPC, a Service
Directory service resource can be provided for connecting to it.
.SH "EXAMPLES"
To create a GitLab connection for gitlab.com, provide all the required
parameters:
.RS 2m
$ gcloud alpha builds connections create gitlab my\-gitlab\-conn \e
\-\-project=myproj \-\-region=us\-central1 \e
\-\-read\-authorizer\-token\-secret\-version=projects/myproj/secrets/\e
read\-pat/versions/1 \e
\-\-authorizer\-token\-secret\-version=projects/myproj/secrets/\e
api\-pat/versions/1 \e
\-\-webhook\-secret\-secret\-version=projects/myproj/secrets/\e
whsecret/versions/1
.RE
To create a GitLab connection for a GitLab server, provide host\-uri parameter
as well:
.RS 2m
$ gcloud alpha builds connections create gitlab my\-gle\-conn \e
\-\-host\-uri=https://my.gle\-server.net \-\-project=myproj \e
\-\-region=us\-central1 \e
\-\-authorizer\-token\-secret\-version=projects/myproj/secrets/\e
api\-pat/versions/1 \e
\-\-read\-authorizer\-token\-secret\-version=projects/myproj/secrets/\e
read\-pat/versions/1 \e
\-\-webhook\-secret\-secret\-version=projects/myproj/secrets/\e
whsecret/versions/1
.RE
To create a GitLab connection for a private GitLab server. provide the
service\-directory\-service and ssl\-ca\-file as well:
.RS 2m
$ gcloud alpha builds connections create gitlab my\-gle\-conn \e
\-\-host\-uri=https://my.private\-gle\-server.net \-\-project=myproj \e
\-\-region=us\-central1 \e
\-\-service\-directory\-service=projects/myproj/namespaces/x/\e
services/mysds \-\-ssl\-ca\-file=mycertificate.crt \e
\-\-authorizer\-token\-secret\-version=projects/myproj/secrets/\e
api\-pat/versions/1 \e
\-\-read\-authorizer\-token\-secret\-version=projects/myproj/secrets/\e
read\-pat/versions/1 \e
\-\-webhook\-secret\-secret\-version=projects/myproj/secrets/\e
whsecret/versions/1
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Connection resource \- Connection to create. The arguments in this group can be
used to specify the attributes of this resource. (NOTE) Some attributes are not
given arguments in this group but can be set in other ways.
To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5connection\fR on the command line with a fully specified
name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
This must be specified.
.RS 2m
.TP 2m
\fICONNECTION\fR
ID of the connection or fully qualified identifier for the connection.
To set the \f5connection\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5connection\fR on the command line.
.RE
.sp
This positional argument must be specified if any of the other arguments in this
group are specified.
.TP 2m
\fB\-\-region\fR=\fIREGION\fR
The Google Cloud region.
To set the \f5region\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5connection\fR on the command line with a fully specified
name;
.IP "\(bu" 2m
provide the argument \f5\-\-region\fR on the command line;
.IP "\(bu" 2m
set the property \f5builds/region\fR.
.RE
.sp
.RE
.RE
.sp
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
\fB\-\-authorizer\-token\-secret\-version\fR=\fIAUTHORIZER_TOKEN_SECRET_VERSION\fR
Secret containing the api personal access token.
.TP 2m
\fB\-\-read\-authorizer\-token\-secret\-version\fR=\fIREAD_AUTHORIZER_TOKEN_SECRET_VERSION\fR
Secret containing the read_api personal access token.
.TP 2m
\fB\-\-webhook\-secret\-secret\-version\fR=\fIWEBHOOK_SECRET_SECRET_VERSION\fR
Secret containing the webhook secret string for validating webhook events sent
by GitLab.
.RE
.sp
.SH "OPTIONAL FLAGS"
.RS 2m
.TP 2m
\fB\-\-async\fR
Return immediately, without waiting for the operation in progress to complete.
.TP 2m
\fB\-\-host\-uri\fR=\fIHOST_URI\fR
URI of the GitLab instance.
.TP 2m
Group of arguments for configuring access through Service Directory.
.RS 2m
.TP 2m
\fB\-\-service\-directory\-service\fR=\fISERVICE_DIRECTORY_SERVICE\fR
Service Directory service resource to use for accessing the gitlab.com or GitLab
Enterprise Server. Necessary only if the server has no public access from the
internet.
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-ssl\-ca\-file\fR=\fISSL_CA_FILE\fR
File containing the SSL_CA to be used.
.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 "API REFERENCE"
This command uses the \fBcloudbuild/v2\fR API. The full documentation for this
API can be found at: https://cloud.google.com/cloud\-build/docs/
.SH "NOTES"
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. These variants are also available:
.RS 2m
$ gcloud builds connections create gitlab
.RE
.RS 2m
$ gcloud beta builds connections create gitlab
.RE