File: //snap/google-cloud-cli/396/help/man/man1/gcloud_alpha_builds_submit.1
.TH "GCLOUD_ALPHA_BUILDS_SUBMIT" 1
.SH "NAME"
.HP
gcloud alpha builds submit \- submit a build using Cloud Build
.SH "SYNOPSIS"
.HP
\f5gcloud alpha builds submit\fR [[\fISOURCE\fR]\ \fB\-\-no\-source\fR] [\fB\-\-async\fR] [\fB\-\-no\-cache\fR] [\fB\-\-default\-buckets\-behavior\fR=\fIDEFAULT_BUCKETS_BEHAVIOR\fR] [\fB\-\-dir\fR=\fIDIR\fR] [\fB\-\-disk\-size\fR=\fIDISK_SIZE\fR] [\fB\-\-gcs\-log\-dir\fR=\fIGCS_LOG_DIR\fR] [\fB\-\-gcs\-source\-staging\-dir\fR=\fIGCS_SOURCE_STAGING_DIR\fR] [\fB\-\-git\-source\-dir\fR=\fIGIT_SOURCE_DIR\fR] [\fB\-\-git\-source\-revision\fR=\fIGIT_SOURCE_REVISION\fR] [\fB\-\-ignore\-file\fR=\fIIGNORE_FILE\fR] [\fB\-\-machine\-type\fR=\fIMACHINE_TYPE\fR] [\fB\-\-polling\-interval\fR=\fIPOLLING_INTERVAL\fR;\ default=1] [\fB\-\-region\fR=\fIREGION\fR] [\fB\-\-revision\fR=\fIREVISION\fR] [\fB\-\-service\-account\fR=\fISERVICE_ACCOUNT\fR] [\fB\-\-substitutions\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-suppress\-logs\fR] [\fB\-\-timeout\fR=\fITIMEOUT\fR] [\fB\-\-worker\-pool\fR=\fIWORKER_POOL\fR] [\fB\-\-config\fR=\fICONFIG\fR;\ default="cloudbuild.yaml"\ |\ \fB\-\-pack\fR=[\fIbuilder\fR=\fIBUILDER\fR],[\fIenv\fR=\fIENV\fR],[\fIimage\fR=\fIIMAGE\fR]\ |\ \fB\-\-tag\fR=\fITAG\fR,\ \fB\-t\fR\ \fITAG\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Submit a build using Cloud Build.
When the \f5builds/use_kaniko\fR property is \f5True\fR, builds submitted with
\f5\-\-tag\fR will use Kaniko (https://github.com/GoogleContainerTools/kaniko)
to execute builds. Kaniko executes directives in a Dockerfile, with remote layer
caching for faster builds. By default, Kaniko will cache layers for 6 hours. To
override this, set the \f5builds/kaniko_cache_ttl\fR property.
.SH "EXAMPLES"
To submit a build with source located at storage URL
\f5gs://bucket/object.zip\fR:
.RS 2m
$ gcloud alpha builds submit "gs://bucket/object.zip" \e
\-\-tag=gcr.io/my\-project/image
.RE
To submit a build with source located at storage URL
\f5gs://bucket/object.zip\fR using config file \f5config.yaml\fR:
.RS 2m
$ gcloud alpha builds submit "gs://bucket/object.zip" \e
\-\-tag=gcr.io/my\-project/image \-\-config=config.yaml
.RE
To submit a build with source from a source manifest:
.RS 2m
$ gcloud alpha builds submit "gs://bucket/manifest.json" \e
\-\-tag=gcr.io/my\-project/image \-\-config=config.yaml
.RE
To submit a build with local source \f5source.tgz\fR asynchronously:
.RS 2m
$ gcloud alpha builds submit "source.tgz" \e
\-\-tag=gcr.io/my\-project/image \-\-async
.RE
To submit a build with source from a Git repository
\f5https://github.com/owner/repo\fR:
.RS 2m
$ gcloud alpha builds submit "https://github.com/owner/repo" \e
\-\-git\-source\-revision=main \-\-config=config.yaml
.RE
To submit a build with source from a 2nd\-gen Cloud Build repository resource
\f5projects/my\-project/locations/us\-west1/connections/my\-conn/repositories/my\-repo\fR:
.RS 2m
$ gcloud alpha builds submit \e
"projects/my\-project/locations/us\-west1/connections/my\-conn/repo\e
sitories/my\-repo" \-\-revision=main
.RE
To submit a build with source from a Developer Connect GitRepositoryLink
resource
\f5projects/my\-project/locations/us\-west1/connections/my\-conn/gitRepositoryLinks/my\-repo\-link\fR:
.RS 2m
$ gcloud alpha builds submit \e
"projects/my\-project/locations/us\-west1/connections/my\-conn/gitR\e
epositoryLinks/my\-repo\-link" \-\-revision=main
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
[\fISOURCE\fR]
The location of the source to build. The location can be a directory on a local
disk, an archive file (e.g., .zip, .tar.gz) or a manifest file (.json) in Google
Cloud Storage, a Git repo url starting with http:// or https://, a 2nd\-gen
Cloud Build repository resource, or a Developer Connect GitRepositoryLink
resource. If the source is a local directory, this command skips the files
specified in the \f5\-\-ignore\-file\fR. If \f5\-\-ignore\-file\fR is not
specified, use\f5.gcloudignore\fR file. If a \f5.gcloudignore\fR file is absent
and a \f5.gitignore\fR file is present in the local source directory, gcloud
will use a generated Git\-compatible \f5.gcloudignore\fR file that respects your
.gitignored files. The global \f5.gitignore\fR is not respected. For more
information on \f5.gcloudignore\fR, see \f5gcloud topic gcloudignore\fR.
.TP 2m
\fB\-\-no\-source\fR
Specify that no source should be uploaded with this build.
.RE
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-async\fR
Return immediately, without waiting for the operation in progress to complete.
.TP 2m
\fB\-\-no\-cache\fR
If set, disable layer caching when building with Kaniko.
This has the same effect as setting the builds/kaniko_cache_ttl property to 0
for this build. This can be useful in cases where Dockerfile builds are
non\-deterministic and a non\-deterministic result should not be cached.
.TP 2m
\fB\-\-default\-buckets\-behavior\fR=\fIDEFAULT_BUCKETS_BEHAVIOR\fR
How default buckets are setup. \fIDEFAULT_BUCKETS_BEHAVIOR\fR must be one of:
\fBdefault\-logs\-bucket\-behavior\-unspecified\fR, \fBlegacy\-bucket\fR,
\fBregional\-user\-owned\-bucket\fR.
.TP 2m
\fB\-\-dir\fR=\fIDIR\fR
Directory, relative to the source root, in which to run the build. This is used
when the build source is a 2nd\-gen Cloud Build repository resource, or a
Developer Connect GitRepositoryLink resource. This must be a relative path. If a
step's \f5dir\fR is specified and is an absolute path, this value is ignored for
that step's execution.
.TP 2m
\fB\-\-disk\-size\fR=\fIDISK_SIZE\fR
Machine disk size (GB) to run the build.
.TP 2m
\fB\-\-gcs\-log\-dir\fR=\fIGCS_LOG_DIR\fR
A directory in Google Cloud Storage to hold build logs. If this field is not
set, \f5gs://[PROJECT_NUMBER].cloudbuild\-logs.googleusercontent.com/\fR will be
created and used or
\f5gs://[PROJECT_NUMBER]\-[builds/region]\-cloudbuild\-logs\fR is used when you
set \f5\-\-default\-buckets\-behavior\fR to \f5REGIONAL_USER_OWNED_BUCKET\fR.
.TP 2m
\fB\-\-gcs\-source\-staging\-dir\fR=\fIGCS_SOURCE_STAGING_DIR\fR
A directory in Google Cloud Storage to copy the source used for staging the
build. If the specified bucket does not exist, Cloud Build will create one. If
you don't set this field, \f5gs://[PROJECT_ID]_cloudbuild/source\fR is used or
\f5gs://[PROJECT_ID]_[builds/region]_cloudbuild/source\fR is used when you set
\f5\-\-default\-buckets\-behavior\fR to \f5REGIONAL_USER_OWNED_BUCKET\fR and
\f5builds/region\fR is not \f5global\fR.
.TP 2m
\fB\-\-git\-source\-dir\fR=\fIGIT_SOURCE_DIR\fR
Directory, relative to the source root, in which to run the build. This must be
a relative path. If a step's \f5dir\fR is specified and is an absolute path,
this value is ignored for that step's execution.
.TP 2m
\fB\-\-git\-source\-revision\fR=\fIGIT_SOURCE_REVISION\fR
Revision to fetch from the Git repository such as a branch, a tag, a commit SHA,
or any Git ref to run the build.
Cloud Build uses \f5git fetch\fR to fetch the revision from the Git repository;
therefore make sure that the string you provide for \f5revision\fR is parsable
by the command. For information on string values accepted by \f5git fetch\fR,
see https://git\-scm.com/docs/gitrevisions#_specifying_revisions. For
information on \f5git fetch\fR, see https://git\-scm.com/docs/git\-fetch.
.TP 2m
\fB\-\-ignore\-file\fR=\fIIGNORE_FILE\fR
Override the \f5.gcloudignore\fR file and use the specified file instead.
.TP 2m
\fB\-\-machine\-type\fR=\fIMACHINE_TYPE\fR
Machine type used to run the build. \fIMACHINE_TYPE\fR must be one of:
\fBe2\-highcpu\-32\fR, \fBe2\-highcpu\-8\fR, \fBe2\-medium\fR,
\fBn1\-highcpu\-32\fR, \fBn1\-highcpu\-8\fR.
.TP 2m
\fB\-\-polling\-interval\fR=\fIPOLLING_INTERVAL\fR; default=1
Amount of time in seconds to wait between polling build status.
.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\-\-revision\fR=\fIREVISION\fR
Revision to fetch from the Git repository such as a branch, a tag, a commit SHA,
or any Git ref to run the build. This is used when the build source is a
2nd\-gen Cloud Build repository resource, or a Developer Connect
GitRepositoryLink resource.
Cloud Build uses \f5git fetch\fR to fetch the revision from the Git repository;
therefore make sure that the string you provide for \f5revision\fR is parsable
by the command. For information on string values accepted by \f5git fetch\fR,
see https://git\-scm.com/docs/gitrevisions#_specifying_revisions. For
information on \f5git fetch\fR, see https://git\-scm.com/docs/git\-fetch.
.TP 2m
\fB\-\-service\-account\fR=\fISERVICE_ACCOUNT\fR
The service account to use with this build. If unset, the default service
account will be used.
.TP 2m
\fB\-\-substitutions\fR=[\fIKEY\fR=\fIVALUE\fR,...]
Parameters to be substituted in the build specification.
For example (using some nonsensical substitution keys; all keys must begin with
an underscore):
.RS 2m
$ gcloud builds submit . \-\-config config.yaml \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".
Only the following built\-in variables can be specified with the
\f5\-\-substitutions\fR flag: REPO_NAME, BRANCH_NAME, TAG_NAME, REVISION_ID,
COMMIT_SHA, SHORT_SHA.
For more details, see:
https://cloud.google.com/cloud\-build/docs/api/build\-requests#substitutions
.TP 2m
\fB\-\-suppress\-logs\fR
If set, build logs not streamed to stdout.
.TP 2m
\fB\-\-timeout\fR=\fITIMEOUT\fR
Maximum time a build is run before it is failed as \f5TIMEOUT\fR. It is
specified as a duration; for example, "2h15m5s" is two hours, fifteen minutes,
and five seconds. If you don't specify a unit, seconds is assumed. For example,
"10" is 10 seconds. Overrides the default \fBbuilds/timeout\fR property value
for this command invocation.
.TP 2m
Worker pool only flags.
.RS 2m
.TP 2m
\fB\-\-worker\-pool\fR=\fIWORKER_POOL\fR
Specify a worker pool for the build to run in. Format:
projects/{project}/locations/{region}/workerPools/{workerPool}.
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-config\fR=\fICONFIG\fR; default="cloudbuild.yaml"
The YAML or JSON file to use as the build configuration file.
.TP 2m
\fB\-\-pack\fR=[\fIbuilder\fR=\fIBUILDER\fR],[\fIenv\fR=\fIENV\fR],[\fIimage\fR=\fIIMAGE\fR]
Uses CNCF buildpack (https://buildpacks.io/) to create the app image. The app
"image" key/value must be provided. The app image name must be in the
\fBgcr.io\fR or \fBpkg.dev\fR namespace. To specify your own builder image use
the optional "builder" key/value argument. By default
\f5gcr.io/buildpacks/builder\fR is used. To pass environment variables to the
builder use the optional "env" key/value argument where value is a list of key
values using escaping
(https://cloud.google.com/sdk/gcloud/reference/topic/escaping) if necessary.
.TP 2m
\fB\-\-tag\fR=\fITAG\fR, \fB\-t\fR \fITAG\fR
The tag to use with a "docker build" image creation. Cloud Build will run a
remote "docker build \-t $TAG .", where $TAG is the tag provided by this flag.
The tag must be in the \fBgcr.io\fR or \fBpkg.dev\fR namespace. Specify a tag if
you want Cloud Build to build using a Dockerfile instead of a build config file.
If you specify a tag in this command, your source must include a Dockerfile. For
instructions on building using a Dockerfile see
https://cloud.google.com/cloud\-build/docs/quickstart\-build.
.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"
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 submit
.RE
.RS 2m
$ gcloud beta builds submit
.RE