LinuxCommandLibrary

gcloud-app

Deploy and manage Google App Engine applications

TLDR

Deploy an app's code and configuration to the App Engine server

$ gcloud app deploy [deployables]
copy

List all versions of all services deployed to the App Engine server
$ gcloud app versions list
copy

Open the current app in a web browser
$ gcloud app browse
copy

Create an App Engine app within the current project
$ gcloud app create
copy

Display the latest App Engine app logs
$ gcloud app logs read
copy

SYNOPSIS

gcloud app [ARGUMENTS] [--OPTION_NAME=VALUE]...

Common Subcommands:
    deploy [SERVICE_YAML_PATH...] [--version=VERSION] [--project=PROJECT_ID]
    browse [--service=SERVICE_NAME] [--version=VERSION]
    logs read
    versions list

PARAMETERS


    The specific operation to perform within the `gcloud app` command group. Examples include deploy (to upload and run application code), browse (to open the application in a web browser), versions (to manage deployed versions), services (to manage application services), instances (to manage VM instances), logs (to read application logs), regions (to list available regions), and create (to create an App Engine application).


    Arguments specific to the chosen subcommand, such as file paths for deployment (e.g., `app.yaml`) or names of services/versions to operate on.

--project=PROJECT_ID
    The Google Cloud project ID to operate on. If not specified, the currently configured project is used.

--version=VERSION
    Specifies the application version to target for operations like deployment, browsing, or traffic management. If not specified during deploy, a unique version ID is generated.

--service=SERVICE_NAME
    Specifies the application service to target, particularly relevant when managing multi-service applications. Defaults to 'default' if not specified.

--verbosity={debug|info|warning|error|critical|none}
    Set the output verbosity level. Defaults to `info`. Useful for troubleshooting.

--format=FORMAT_TYPE
    Specifies the output format for command results (e.g., `json`, `yaml`, `text`, `list`, `table`). Useful for scripting.

--help
    Displays detailed help for the command or subcommand, including all available options and examples.

--no-promote
    (Specific to `deploy`) Prevents the deployed version from receiving all traffic immediately upon successful deployment. Traffic must be manually split later.

--stop-previous-version
    (Specific to `deploy`) Stops the previously deployed version when a new version is successfully deployed and promoted. Useful for resource management.

--bucket=BUCKET_NAME
    (Specific to `deploy`) Specifies a Google Cloud Storage bucket to use for staging application files. Defaults to a bucket automatically created by gcloud.

DESCRIPTION

The `gcloud app` command group is an essential part of the Google Cloud SDK, specifically designed for interacting with and managing Google App Engine applications. App Engine is a fully managed, serverless platform for developing and hosting web applications at scale. This command group provides a comprehensive set of functionalities, enabling developers to deploy new versions of their applications, manage existing services and versions, view logs, scale instances, and configure various aspects of their App Engine projects. It streamlines the development workflow by offering command-line control over the entire application lifecycle on Google Cloud Platform, from initial deployment to ongoing maintenance and monitoring. Key operations include deploying application code, browsing deployed applications, managing traffic splitting between versions, and inspecting service health. Note that `gcloud-app` is commonly understood as referring to this `gcloud app` command group.

CAVEATS

The `gcloud app` command group requires the Google Cloud SDK to be installed and properly configured, including authentication with a Google Cloud account. Operations like `deploy` can incur costs, so it's important to understand App Engine pricing and resource usage. Deployments can take several minutes depending on application size, dependencies, and network conditions. Users must have appropriate IAM permissions within the target Google Cloud project to perform `gcloud app` operations, typically 'App Engine Admin' or similar roles.

APP ENGINE ENVIRONMENTS

App Engine offers two main environments: the Standard environment (ideal for rapid scaling and low cost with language-specific runtimes) and the Flexible environment (providing more customization, custom runtimes, and Docker support). The `gcloud app deploy` command can deploy applications to either environment, typically determined by the `runtime` specified in the `app.yaml` configuration file.

CONFIGURATION FILES

App Engine applications are configured using a set of YAML files deployed alongside your code. Key files include `app.yaml` (main application configuration), `dispatch.yaml` (for routing requests to specific services), `index.yaml` (for Datastore indexes), and `cron.yaml` (for scheduled tasks). These files are typically deployed together with your application code using `gcloud app deploy`.

HISTORY

The `gcloud` command-line tool, which encompasses `gcloud app`, was first introduced as part of the Google Cloud SDK, aiming to provide a unified interface for managing all Google Cloud resources. The `gcloud app` command group specifically evolved to manage Google App Engine applications, largely replacing or complementing earlier standalone tools like `appcfg.py` for application deployment and management. Its development has focused on enhancing developer productivity, supporting new App Engine features (such as services and the flexible environment), and integrating seamlessly with other Google Cloud services, offering a consistent command-line experience across the platform.

SEE ALSO

gcloud(1), gcloud auth(1), gcloud config(1), gsutil(1), kubectl(1)

Copied to clipboard