File: //snap/google-cloud-cli/394/help/man/man1/gcloud_alpha_functions_local_deploy.1
.TH "GCLOUD_ALPHA_FUNCTIONS_LOCAL_DEPLOY" 1
.SH "NAME"
.HP
gcloud alpha functions local deploy \- deploy a Google Cloud Function locally
.SH "SYNOPSIS"
.HP
\f5gcloud alpha functions local deploy\fR \fINAME\fR [\fB\-\-builder\fR=\fIBUILDER\fR] [\fB\-\-entry\-point\fR=\fIENTRY_POINT\fR] [\fB\-\-ignore\-file\fR=\fIIGNORE_FILE\fR] [\fB\-\-port\fR=\fIPORT\fR;\ default=8080] [\fB\-\-runtime\fR=\fIRUNTIME\fR] [\fB\-\-source\fR=\fISOURCE\fR] [\fB\-\-build\-env\-vars\-file\fR=\fIFILE_PATH\fR\ |\ \fB\-\-clear\-build\-env\-vars\fR\ |\ \fB\-\-set\-build\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ |\ \fB\-\-remove\-build\-env\-vars\fR=[\fIKEY\fR,...]\ \fB\-\-update\-build\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-clear\-env\-vars\fR\ |\ \fB\-\-env\-vars\-file\fR=\fIFILE_PATH\fR\ |\ \fB\-\-set\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ |\ \fB\-\-remove\-env\-vars\fR=[\fIKEY\fR,...]\ \fB\-\-update\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR \f5gcloud alpha functions local deploy\fR Deploy a Google Cloud
Function locally.
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
\fINAME\fR
Name of the locally deployed Google Cloud function.
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-builder\fR=\fIBUILDER\fR
Name of the builder to use for pack, e.g.
\f5gcr.io/serverless\-runtimes/google\-22\-full/builder/go\fR.
.TP 2m
\fB\-\-entry\-point\fR=\fIENTRY_POINT\fR
Name of a Google Cloud Function (as defined in source code) that will be
executed. Defaults to the resource name suffix (ID of the function), if not
specified.
.TP 2m
\fB\-\-ignore\-file\fR=\fIIGNORE_FILE\fR
Override the .gcloudignore file in the source directory and use the specified
file instead. By default, the source directory is your current directory. Note
that it could be changed by the \-\-source flag, in which case your
.gcloudignore file will be searched in the overridden directory. For example,
\f5\-\-ignore\-file=.mygcloudignore\fR combined with \f5\-\-source=./mydir\fR
would point to \f5./mydir/.mygcloudignore\fR
.TP 2m
\fB\-\-port\fR=\fIPORT\fR; default=8080
Port for the deployment to run on. The default port is 8080 for new local
deployments.
.TP 2m
\fB\-\-runtime\fR=\fIRUNTIME\fR
Runtime in which to run the function.
Required when deploying a new function; optional when updating an existing
function.
For a list of available runtimes, run \f5gcloud functions runtimes list\fR.
.TP 2m
\fB\-\-source\fR=\fISOURCE\fR
Location of source code to deploy.
Location of the source can be one of the following three options:
.RS 2m
.IP "\(em" 2m
Source code in Google Cloud Storage (must be a \f5.zip\fR archive),
.IP "\(em" 2m
Reference to source repository or,
.IP "\(em" 2m
Local filesystem path (root directory of function source).
.RE
.sp
Note that, depending on your runtime type, Cloud Functions will look for files
with specific names for deployable functions. For Node.js, these filenames are
\f5index.js\fR or \f5function.js\fR. For Python, this is \f5main.py\fR.
If you do not specify the \f5\-\-source\fR flag:
.RS 2m
.IP "\(em" 2m
The current directory will be used for new function deployments.
.IP "\(em" 2m
If the function was previously deployed using a local filesystem path, then the
function's source code will be updated using the current directory.
.IP "\(em" 2m
If the function was previously deployed using a Google Cloud Storage location or
a source repository, then the function's source code will not be updated.
.RE
.sp
The value of the flag will be interpreted as a Cloud Storage location, if it
starts with \f5gs://\fR.
The value will be interpreted as a reference to a source repository, if it
starts with \f5https://\fR.
Otherwise, it will be interpreted as the local filesystem path. When deploying
source from the local filesystem, this command skips files specified in the
\f5.gcloudignore\fR file (see \f5gcloud topic gcloudignore\fR for more
information). If the \f5.gcloudignore\fR file doesn't exist, the command will
try to create it.
The minimal source repository URL is:
\f5https://source.developers.google.com/projects/${PROJECT}/repos/${REPO}\fR
By using the URL above, sources from the root directory of the repository on the
revision tagged \f5master\fR will be used.
If you want to deploy from a revision different from \f5master\fR, append one of
the following three sources to the URL:
.RS 2m
.IP "\(em" 2m
\f5/revisions/${REVISION}\fR,
.IP "\(em" 2m
\f5/moveable\-aliases/${MOVEABLE_ALIAS}\fR,
.IP "\(em" 2m
\f5/fixed\-aliases/${FIXED_ALIAS}\fR.
.RE
.sp
If you'd like to deploy sources from a directory different from the root, you
must specify a revision, a moveable alias, or a fixed alias, as above, and
append \f5/paths/${PATH_TO_SOURCES_DIRECTORY}\fR to the URL.
Overall, the URL should match the following regular expression:
.RS 2m
^https://source\e.developers\e.google\e.com/projects/
(?<accountId>[^/]+)/repos/(?<repoName>[^/]+)
(((/revisions/(?<commit>[^/]+))|(/moveable\-aliases/(?<branch>[^/]+))|
(/fixed\-aliases/(?<tag>[^/]+)))(/paths/(?<path>.*))?)?$
.RE
An example of a validly formatted source repository URL is:
.RS 2m
https://source.developers.google.com/projects/123456789/repos/testrepo/
moveable\-aliases/alternate\-branch/paths/path\-to=source
.RE
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-build\-env\-vars\-file\fR=\fIFILE_PATH\fR
Path to a local YAML file with definitions for all build environment variables.
All existing build environment variables will be removed before the new build
environment variables are added.
.TP 2m
\fB\-\-clear\-build\-env\-vars\fR
Remove all build environment variables.
.TP 2m
\fB\-\-set\-build\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as build environment variables. All existing
build environment variables will be removed first.
.TP 2m
Only \-\-update\-build\-env\-vars and \-\-remove\-build\-env\-vars can be used
together. If both are specified, \-\-remove\-build\-env\-vars will be applied
first.
.RS 2m
.TP 2m
\fB\-\-remove\-build\-env\-vars\fR=[\fIKEY\fR,...]
List of build environment variables to be removed.
.TP 2m
\fB\-\-update\-build\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as build environment variables.
.RE
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-clear\-env\-vars\fR
Remove all environment variables.
.TP 2m
\fB\-\-env\-vars\-file\fR=\fIFILE_PATH\fR
Path to a local YAML file with definitions for all environment variables. All
existing environment variables will be removed before the new environment
variables are added.
.TP 2m
\fB\-\-set\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as environment variables. All existing
environment variables will be removed first.
.TP 2m
Only \-\-update\-env\-vars and \-\-remove\-env\-vars can be used together. If
both are specified, \-\-remove\-env\-vars will be applied first.
.RS 2m
.TP 2m
\fB\-\-remove\-env\-vars\fR=[\fIKEY\fR,...]
List of environment variables to be removed.
.TP 2m
\fB\-\-update\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as environment variables.
.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"
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.