gcloud app deploy Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud app deploy - deploy the local code and/or configuration of your app to App Engine
- SYNOPSIS
gcloud app deploy[DEPLOYABLES…][--appyaml=APPYAML][--bucket=BUCKET][--no-cache][--ignore-file=IGNORE_FILE][--image-url=IMAGE_URL][--no-promote][--service-account=SERVICE_ACCOUNT][--no-stop-previous-version][--version=VERSION,-vVERSION][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
- This command is used to deploy both code and configuration to the App Engineserver. As an input it takes one or more DEPLOYABLES that should be uploaded. ADEPLOYABLE can be a service's .yaml file or a configuration's .yaml file (formore information about configuration files specific to your App Engineenvironment, refer tohttps://cloud.google.com/appengine/docs/standard/configuration-filesor https://cloud.google.com/appengine/docs/flexible/configuration-files). Note,for Java 8 Standard apps or Java 11/17/21 Standard apps using bundled services,you must add the path to the appengine-web.xml file inside the WEB-INFdirectory. gcloud app deploy skips files specified in the .gcloudignore file(see gcloud topic gcloudignore for more information). For Java 11 Standard, youcan either use the yaml file, a Maven pom.xml, or a Gradle build.gradle.Alternatively, if the application is a single self-contained jar, you can givethe path to the jar and a simple service configuration will be generated. Youcan deploy Java 11 Maven source projects by specifying the location of yourproject's pom.xml file, and it will be built and deployed using App EngineBuildpacks.
- EXAMPLES
- To deploy a single service, run:
gcloudappdeploy~/my_app/app.yamlTo deploy an App Engine Standard Java8 service or a Java11 service using bundledservices, run:
gcloudappdeploy~/my_app/WEB-INF/appengine-web.xmlTo deploy an App Engine Standard Java11 single jar, run:
gcloudappdeploy~/my_app/my_jar.jarTo deploy an App Engine Standard Java11 Maven source project, run:
gcloudappdeploy~/my_app/pom.xmlTo deploy an App Engine Standard Java11 Gradle source project, run:
gcloudappdeploy~/my_app/build.gradleBy default, the service is deployed to the current project configured via:
gcloudconfigsetcore/projectPROJECTTo override this value for a single deployment, use the
flag:--projectgcloudappdeploy~/my_app/app.yaml--project=PROJECTTo deploy multiple services, run:
gcloudappdeploy~/my_app/app.yaml~/my_app/another_service.yamlTo change the default --promote behavior for your current environment, run:
gcloudconfigsetapp/promote_by_defaultfalseTo deploy a service that will run as a service account, run:
gcloudappdeploy~/my_app/app.yaml--service-account=SERVICE_ACCOUNT - POSITIONAL ARGUMENTS
- [
DEPLOYABLES…] - The yaml files for the services or configurations you want to deploy. If notgiven, defaults to
app.yamlin the current directory. If that isnot found, attempts to automatically generate necessary configuration files(such as app.yaml) in the current directory.
- [
- FLAGS
--appyaml=APPYAML- Deploy with a specific app.yaml that will replace the one defined in theDEPLOYABLE.
--bucket=BUCKET- The Google Cloud Storage bucket used to stage files associated with thedeployment. If this argument is not specified, the application's default codebucket is used.
--cache- Enable caching mechanisms involved in the deployment process, particularly inthe build step. Enabled by default, use
--no-cacheto disable. --ignore-file=IGNORE_FILE- Override the .gcloudignore file and use the specified file instead.
--image-url=IMAGE_URL- (App Engine flexible environment only.) Deploy with a specific Docker image.Docker url must be from one of the valid Artifact Registry hostnames.
--promote- Promote the deployed version to receive all traffic. Overrides the default
app/promote_by_defaultproperty value for this command invocation.Use--no-promoteto disable. --service-account=SERVICE_ACCOUNT- The service account that this deployed version will run as. If this argument isnot specified, the App Engine default service account will be used for yourcurrent deployed version.
--stop-previous-version- Stop the previously running version when deploying a new version that receivesall traffic.
Note that if the version is running on an instance of an auto-scaled service inthe App Engine Standard environment, using
--stop-previous-versionwill not work and the previous version will continue to run because auto-scaledservice instances are always running.Overrides the default
app/stop_previous_versionproperty value forthis command invocation. Use--no-stop-previous-versionto disable. --version=VERSION,-vVERSION- The version of the app that will be created or replaced by this deployment. Ifyou do not specify a version, one will be generated for you.
- 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
$gcloud helpfor details. - NOTES
- This variant is also available:
gcloudbetaappdeploy
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-07 UTC.