
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
In this series of labs, you take a demo microservices Java application built with the Spring framework and modify it to use an external database server. You adopt some of the best practices for tracing, configuration management, and integration with other services using integration patterns.
So far in the labs, you've tested the application by running the application in Cloud Shell. Many options are available to deploy your application on Google Cloud. For example, you can deploy the application to virtual machines that you configure yourself. Or you can containerize your application and deploy it into a managed Google Kubernetes Engine cluster. You can also run your favorite platform as a service on Google Cloud (for example, Cloud Foundry and OpenShift).
App Engine is Google's fully managed serverless application platform. With App Engine, you can build and deploy applications on a fully managed platform. You can scale your applications without having to worry about managing the underlying infrastructure. App Engine includes capabilities such as automatic scaling-up and scaling-down of your application, and fully managed patching and management of your servers.
In this lab, you deploy the application into App Engine. You convert the application from fat WARs into the thin-WAR deployments that App Engine can deploy.
In this lab, you learn how to perform the following tasks:
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is a panel populated with the temporary credentials that you must use for this lab.
Copy the username, and then click Open Google Console. The lab spins up resources, and then opens another tab that shows the Choose an account page.
On the Choose an account page, click Use Another Account. The Sign in page opens.
Paste the username that you copied from the Connection Details panel. Then copy and paste the password.
After a few moments, the Cloud console opens in this tab.
After you complete the initial sign-in steps, the project dashboard appears.
In this task, you clone the source repository files that are used throughout this lab.
To begin the lab, click the Activate Cloud Shell button at the top of the Google Cloud Console and if prompted click Continue.
To activate the code editor, click the Open Editor
button on the toolbar of the Cloud Shell window.
Click Open in a new window
to set up the editor in a new tab with continued access to Cloud Shell.
Open Terminal
and then enter the following command to create an environment variable that contains the project ID for this lab:Now you're ready to go!
In this task, you initialize App Engine by enabling it in the project.
The message The app is now created
indicates that App Engine is enabled.
In this task, you add the App Engine plugin to the guestbook frontend's pom.xml
file.
~/guestbook-frontend/pom.xml
.<plugin>
section, immediately before the closing </plugins>
tag:In the Cloud Shell code editor, create a file named app.yaml
in the ~/guestbook-frontend/src/main/appengine/
directory. This file is required to deploy the application to App Engine.
Add the following code to the app.yaml
file. Make sure to replace PROJECT_ID
with your Project ID. You can use the command echo $PROJECT_ID
in the Cloud Shell to retrieve it:
This command reports out success like the following example:
This command reports a URL that links to your application's frontend:
An error occurs because the backend isn't deployed yet:
Leave the tab open. You'll come back to this later.
In this task, you will add the App Engine Plugin to guestbook-service's pom.xml
.
~/guestbook-service/pom.xml
file, add the following code at the end of the <plugin>
section, immediately before the closing </plugins>
tag:In the Cloud Shell code editor, create a file named app.yaml
in the ~/guestbook-service/src/main/appengine/
directory. This file is required to deploy the application to App Engine.
Add the following code to the app.yaml
file:
guestbook-service
directory, then use Maven to deploy the application. This will take a few minutes:Links similar to the ones in the screenshot are displayed. You can use these URLs to list and inspect the contents of messages that have been posted to the application:
https://guestbook-service-dot-PROJECT.appspot.com/guestbookMessages
, and see the sample message that is preloaded by the lab setup process:In this lab, you initialized App Engine and reconfigured an application to work with App Engine. You also configured the Cloud Runtime Configuration API to automatically provide the backend URL to the Frontend application. Finally, you deployed the application to App Engine.
When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one