@@ -432,8 +432,64 @@ Maven build to run the app.
432
432
433
433
434
434
[[cloud-deployment-gae]]
435
- === Google App Engine
436
- Google App Engine is tied to the Servlet 2.5 API, so you can't deploy a Spring Application
435
+ === Google Cloud
436
+
437
+ Google Cloud has several options that could be used to launch Spring Boot applications. The
438
+ easiest to get started with is probably App Engine, but you could also find ways to run
439
+ Spring Boot in a container with Container Engine, or on a virtual machine using Compute Engine.
440
+
441
+ To run in App Engine you can create a project in the UI first, which
442
+ sets up a unique identifier for you and also HTTP routes. Add a Java
443
+ app to the project and leave it empty, then use the
444
+ https://cloud.google.com/sdk/downloads[Google Cloud SDK] to push your
445
+ Spring Boot app into that slot from the command line or CI build.
446
+
447
+ App Engine needs you to create an `app.yaml` file to describe the
448
+ resources your app requires. Normally you put this in
449
+ `src/min/appengine`, and it looks something like this:
450
+
451
+ [source,yaml,indent=0]
452
+ ----
453
+ service: default
454
+
455
+ runtime: java
456
+ env: flex
457
+
458
+ runtime_config:
459
+ jdk: openjdk8
460
+
461
+ handlers:
462
+ - url: /.*
463
+ script: this field is required, but ignored
464
+
465
+ manual_scaling:
466
+ instances: 1
467
+
468
+ health_check:
469
+ enable_health_check: False
470
+
471
+ env_variables:
472
+ ENCRYPT_KEY: your_encryption_key_here
473
+ ----
474
+
475
+ You can deploy the app, for example, with a Maven plugin by simply
476
+ adding the project ID to the build configuration:
477
+
478
+ [source,xml,indent=0,subs="verbatim,quotes,attributes"]
479
+ ----
480
+ <plugin>
481
+ <groupId>com.google.cloud.tools</groupId>
482
+ <artifactId>appengine-maven-plugin</artifactId>
483
+ <version>1.3.0</version>
484
+ <configuration>
485
+ <project>myproject</project>
486
+ </configuration>
487
+ </plugin>
488
+ ----
489
+
490
+ Then deploy with `mvn appengine:deploy` (if you need to authenticate first the build will fail).
491
+
492
+ NOTE: Google App Engine Classic is tied to the Servlet 2.5 API, so you can't deploy a Spring Application
437
493
there without some modifications. See the <<howto.adoc#howto-servlet-2-5, Servlet 2.5 section>>
438
494
of this guide.
439
495
0 commit comments