Deploying to the App Engine Flexible Environment

This document describes how to deploy an App Engine application to the App Engine flexible environment from within IntelliJ IDEA.

Before you begin

  • Follow the Quickstart to install and set up IntelliJ IDEA if you have not already. Then return to this document.

  • To deploy to the flexible environment, you can use either IntelliJ IDEA Community Edition or Ultimate Edition.

  • Follow the Create an App guide to create an App Engine app for the flexible environment. Be sure to add App Engine flexible framework support.

    If you don't have an application but still want to try these deployment procedures, download the sample app:

    1. Clone the Spring Boot sample app to your local machine:

      git clone https://github.com/spring-guides/gs-spring-boot
      
    2. In IntelliJ, choose File > Open to open the file selector.

    3. Navigate to /gs-spring-boot/.

    4. Select the /complete/ directory.

    5. Click OK.

    6. Add App Engine flexible framework support.

Creating the deployment configuration

  1. Choose Tools > Google Cloud Tools > Deploy to App Engine....

    The create Deployment Configuration dialog. Has fields for Name,
Server, Deployment, Project, Version, and app.yaml.

  2. Confirm the server configuration:

    1. Click the ellipsis (...) next to the Server field.

    2. In the dialog, verify that the Name field displays Google App Engine.

    3. Verify that the Cloud SDK directory field displays the correct path to where you installed the Cloud SDK.

    4. Click OK.

  3. Select the Deployment source.

    Cloud Tools for IntelliJ supports deploying from a Maven artifact, a native IntelliJ artifact, or a filesystem JAR or WAR file.

    1. If you select a filesystem JAR or WAR file as your deployment source, click the ellipsis (...) next to the Deployment archive field to navigate to the deployment archive.

  4. Select a project in the Project field.

    The first time you configure the deployment, you will be prompted to sign in to the account associated with the GCP Console project that you want to deploy.

  5. In the App Engine Flexible Configuration section, select a valid app.yaml file.

    1. If you don't see a valid app.yaml file in the drop-down menu, click Edit to select a file. See the Update the App Engine flexible configurations section for more information.

  6. Fill in other fields as needed to configure the deployment.

  7. Click Run to build and deploy your app.

  8. In the Application Servers window, click the name of your project to monitor its deployment progress. If the window is not displaying, click View > Tool Windows > Application Servers.

    After deployment completes, you can view your app's URL in the console output.

Deploying to a custom runtime

You can modify your app.yaml file to deploy your app to a custom runtime using a Docker file.

  1. In your app.yaml file, set your runtime to custom.

  2. As you complete the creating the deployment configuration steps, the App Engine Flexible Configuration section displays the path to your app.yaml and Docker file.

    Dialog showing the app engine flexible configuration
section of the create deployment configurations screen. A field shows the
path to the app.yaml file. There is an edit button to select a different
file. A label shows the runtime as custom. A label shows the path of the
Docker file. A Staged artifact name field shows the path to the Docker
file.

  3. Click Edit to select valid app.yaml and Docker files.

    Dialog showing the app engine flexible configuration
section of the create deployment configurations screen. A field shows the
path to the app.yaml file. There is an edit button to select a different
file. A label shows the runtime as custom. A label shows the path of the
Docker file. A Staged artifact name field shows the path to the Docker
file.

  4. Click the ellipsis (...) next to the app.yaml and the Dockerfile Directory fields to navigate to the appropriate files.

  5. Click OK.

Update the App Engine flexible configurations

After creating the initial deployment configuration, you can make changes to those configurations as needed by your application.

  1. Select File > Project Structure.

    The Project Structure dialog displays.

  2. Under Project Settings, select Facets.

  3. Select the Google App Engine flexible facet.

  4. To select an app.yaml file, click the ellipsis (...) next to the app.yaml field to navigate to the location of a valid file.

  5. If you deploy to a custom runtime, click the ellipsis (...) next to the Dockerfile directory field to navigate to the location of a valid file.

  6. Click OK.

Deleting the server

If you ever want to delete the server you configured for your project, you can do so as follows:

  1. Choose File > Settings > Build, Execution, Deployment > Clouds.

    On Mac OS X, this is IntelliJ IDEA > Preferences > Build, Execution, Deployment > Clouds.

  2. Select your server (Google App Engine) and click the minus sign (-) at the top of the window to remove it.

  3. Click OK.

What's next

Send feedback about...

Cloud Tools for IntelliJ