mirror of
https://github.com/imjasonh/gcloud-help
synced 2026-07-16 20:36:39 +00:00
gcloud: Thu Sep 7 10:42:28 UTC 2023
This commit is contained in:
parent
f9edf67fe5
commit
6c8d2eb024
307 changed files with 4053 additions and 1615 deletions
|
|
@ -4,8 +4,16 @@ NAME
|
|||
|
||||
SYNOPSIS
|
||||
gcloud alpha functions local deploy NAME [--builder=BUILDER]
|
||||
[--entry-point=ENTRY_POINT] [--port=PORT; default=8080]
|
||||
[--runtime=RUNTIME] [GCLOUD_WIDE_FLAG ...]
|
||||
[--entry-point=ENTRY_POINT] [--ignore-file=IGNORE_FILE]
|
||||
[--port=PORT; default=8080] [--runtime=RUNTIME] [--source=SOURCE]
|
||||
[--build-env-vars-file=FILE_PATH | --clear-build-env-vars
|
||||
| --set-build-env-vars=[KEY=VALUE,...]
|
||||
| --remove-build-env-vars=[KEY,...]
|
||||
--update-build-env-vars=[KEY=VALUE,...]]
|
||||
[--clear-env-vars | --env-vars-file=FILE_PATH
|
||||
| --set-env-vars=[KEY=VALUE,...]
|
||||
| --remove-env-vars=[KEY,...] --update-env-vars=[KEY=VALUE,...]]
|
||||
[GCLOUD_WIDE_FLAG ...]
|
||||
|
||||
DESCRIPTION
|
||||
(ALPHA) gcloud alpha functions local deploy Deploy a Google Cloud Function
|
||||
|
|
@ -25,8 +33,12 @@ FLAGS
|
|||
be executed. Defaults to the resource name suffix (ID of the function),
|
||||
if not specified.
|
||||
|
||||
--ignore-file=IGNORE_FILE
|
||||
Override the .gcloudignore file and use the specified file instead.
|
||||
|
||||
--port=PORT; default=8080
|
||||
Port for the deployment to run on.
|
||||
Port for the deployment to run on. The default port is 8080 for new
|
||||
local deployments.
|
||||
|
||||
--runtime=RUNTIME
|
||||
Runtime in which to run the function.
|
||||
|
|
@ -36,7 +48,117 @@ FLAGS
|
|||
|
||||
For a list of available runtimes, run gcloud functions runtimes list.
|
||||
|
||||
RUNTIME must be one of: python, go, java, nodejs, php, ruby, dotnet.
|
||||
--source=SOURCE
|
||||
Location of source code to deploy.
|
||||
|
||||
Location of the source can be one of the following three options:
|
||||
|
||||
◆ Source code in Google Cloud Storage (must be a .zip archive),
|
||||
◆ Reference to source repository or,
|
||||
◆ Local filesystem path (root directory of function source).
|
||||
|
||||
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 index.js or function.js. For Python, this is
|
||||
main.py.
|
||||
|
||||
If you do not specify the --source flag:
|
||||
|
||||
◆ The current directory will be used for new function deployments.
|
||||
◆ If the function was previously deployed using a local filesystem
|
||||
path, then the function's source code will be updated using the
|
||||
current directory.
|
||||
◆ 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.
|
||||
|
||||
The value of the flag will be interpreted as a Cloud Storage location,
|
||||
if it starts with gs://.
|
||||
|
||||
The value will be interpreted as a reference to a source repository, if
|
||||
it starts with https://.
|
||||
|
||||
Otherwise, it will be interpreted as the local filesystem path. When
|
||||
deploying source from the local filesystem, this command skips files
|
||||
specified in the .gcloudignore file (see gcloud topic gcloudignore for
|
||||
more information). If the .gcloudignore file doesn't exist, the command
|
||||
will try to create it.
|
||||
|
||||
The minimal source repository URL is:
|
||||
https://source.developers.google.com/projects/${PROJECT}/repos/${REPO}
|
||||
|
||||
By using the URL above, sources from the root directory of the
|
||||
repository on the revision tagged master will be used.
|
||||
|
||||
If you want to deploy from a revision different from master, append one
|
||||
of the following three sources to the URL:
|
||||
|
||||
◆ /revisions/${REVISION},
|
||||
◆ /moveable-aliases/${MOVEABLE_ALIAS},
|
||||
◆ /fixed-aliases/${FIXED_ALIAS}.
|
||||
|
||||
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 /paths/${PATH_TO_SOURCES_DIRECTORY} to the URL.
|
||||
|
||||
Overall, the URL should match the following regular expression:
|
||||
|
||||
^https://source\.developers\.google\.com/projects/
|
||||
(?<accountId>[^/]+)/repos/(?<repoName>[^/]+)
|
||||
(((/revisions/(?<commit>[^/]+))|(/moveable-aliases/(?<branch>[^/]+))|
|
||||
(/fixed-aliases/(?<tag>[^/]+)))(/paths/(?<path>.*))?)?$
|
||||
|
||||
An example of a validly formatted source repository URL is:
|
||||
|
||||
https://source.developers.google.com/projects/123456789/repos/testrepo/
|
||||
moveable-aliases/alternate-branch/paths/path-to=source
|
||||
|
||||
At most one of these can be specified:
|
||||
|
||||
--build-env-vars-file=FILE_PATH
|
||||
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.
|
||||
|
||||
--clear-build-env-vars
|
||||
Remove all build environment variables.
|
||||
|
||||
--set-build-env-vars=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as build environment variables. All
|
||||
existing build environment variables will be removed first.
|
||||
|
||||
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.
|
||||
|
||||
--remove-build-env-vars=[KEY,...]
|
||||
List of build environment variables to be removed.
|
||||
|
||||
--update-build-env-vars=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as build environment variables.
|
||||
|
||||
At most one of these can be specified:
|
||||
|
||||
--clear-env-vars
|
||||
Remove all environment variables.
|
||||
|
||||
--env-vars-file=FILE_PATH
|
||||
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.
|
||||
|
||||
--set-env-vars=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as environment variables. All existing
|
||||
environment variables will be removed first.
|
||||
|
||||
Only --update-env-vars and --remove-env-vars can be used together. If
|
||||
both are specified, --remove-env-vars will be applied first.
|
||||
|
||||
--remove-env-vars=[KEY,...]
|
||||
List of environment variables to be removed.
|
||||
|
||||
--update-env-vars=[KEY=VALUE,...]
|
||||
List of key-value pairs to set as environment variables.
|
||||
|
||||
GCLOUD WIDE FLAGS
|
||||
These flags are available to all commands: --access-token-file, --account,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue