Overview
In this article, I’m going to describe how to create a small App Engine application deployment on Google Cloud Platform.
In this session you will:
- Download starter code from a GitHub.
- Run your application locally from a Cloud Shell.
- Deploy your application with Google App Engine.
Prerequisites
- Google cloud platform subscription.
Step 1
Step 2
Activate Cloud shell.
Click the right corner of the cloud shell button.
Click Continue.
Step 3
Enable Google App Engine Admin API,
- Click Navigation Menu > APIs & Services > Library.
- Type "App Engine Admin API" in the search box.
- Click App Engine Admin API.
- Enabled window
Step 4
Download the Hello world app
Run the following command in cloud shell
Step 5
Then go to the directory in the following command
d getting-started-java/appengine-standard-java8/helloworld
Step 6
Test the application using the application development server
Maven command to download and install Maven and run the app in the following command in cloud shell:
mvn.appengine:run
Output
[INFO]GCLOUD : INFO dev app server is now running.
View the app Click Web preview button > Preview on port 8080
Page should reassemble the following,
Step 7 - Deploy the app
Create an application on an App Engine with the following command
gcloud app create
Output
Do not use gcloud app deploy command as begun in the output to deploy the app, instead, run the following command to deploy the application.
mvn:appengine:deploy
You should get the following output,
Step 8 - View the application
Launch the browser in the following command,
gcloud app browse
OUTPUT
The application is deployed and displays the short message in the browser.