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.
If you don't have an application but still want to try these deployment procedures, download the sample app:
Clone the Spring Boot sample app to your local machine:
git clone https://github.com/spring-guides/gs-spring-boot
In IntelliJ, choose File > Open to open the file selector.
Creating the deployment configuration
Choose Tools > Cloud Code > Deploy to App Engine.
Confirm the server configuration:
Click the ellipsis (...) next to the Server field.
In the dialog, verify that the Name field displays Google App Engine.
Select the Deployment source.
Cloud Code supports deploying from a Maven artifact, a native IntelliJ artifact, or a filesystem JAR or WAR file.
- 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.
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.
In the App Engine Flexible Configuration section, select a valid
- If you don't see a valid
app.yamlfile in the drop-down menu, click Edit to select a file. See the Update the App Engine flexible configurations section for more information.
- If you don't see a valid
Fill in other fields as needed to configure the deployment.
Click Run to build and deploy your app.
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.
app.yamlfile, set your runtime to custom.
As you complete the creating the deployment configuration steps, the App Engine Flexible Configuration section displays the path to your
app.yamland Docker file.
Click Edit to select valid
app.yamland Docker files.
Click the ellipsis (...) next to the
app.yamland the Dockerfile Directory fields to navigate to the appropriate files.
Update the App Engine flexible configurations
After creating the initial deployment configuration, you can make changes to those configurations as needed by your application.
Select File > Project Structure.
The Project Structure dialog displays.
Under Project Settings, select Facets.
Select the App Engine flexible facet.
To select an
app.yamlfile, click the ellipsis (...) next to the app.yaml field to navigate to the location of a valid file.
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.
Deleting the server
If you ever want to delete the server you configured for your project, you can do so as follows:
Choose File > Settings > Build, Execution, Deployment > Clouds.
On macOS, this is IntelliJ IDEA > Preferences > Build, Execution, Deployment > Clouds.
Select your server (App Engine) and click the minus sign (-) at the top of the window to remove it.
You can add your project to Cloud Source Repositories if you haven't done so already.