Skip to content

Commit 62d2b41

Browse files
author
Phillip Webb
committed
Polish documentation
Apply consistent styling and edit a few section for clarity.
1 parent e032b67 commit 62d2b41

File tree

3 files changed

+182
-136
lines changed

3 files changed

+182
-136
lines changed

spring-boot-docs/src/main/asciidoc/cloud-deployment.adoc

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -235,63 +235,70 @@ an extensive https://github.com/CloudBees-community/springboot-gradle-cloudbees
235235
that covers the steps that you need to follow when deploying to CloudBees.
236236

237237

238+
238239
[[cloud-deployment-openshift]]
239240
== Openshift
240241
https://www.openshift.com/[Openshift] is the RedHat public (and enterprise) PaaS solution.
241242
Like Heroku, it works by running scripts triggered by git commits, so you can script
242-
the launching of a Spring Boot app in pretty much any way you like as long as the
243-
Java runtime is available (which is a standard feature you can ask from at Openshift).
244-
To do this you can use the https://www.openshift.com/developers/do-it-yourself[DIY Cartridge]
245-
and hooks in your repository under `.openshift/action_scripts`:
243+
the launching of a Spring Boot application in pretty much any way you like as long as the
244+
Java runtime is available (which is a standard feature you can ask for at Openshift).
245+
To do this you can use the
246+
https://www.openshift.com/developers/do-it-yourself[DIY Cartridge] and hooks in your
247+
repository under `.openshift/action_scripts`:
246248

247249
The basic model is to:
248250

249-
1. Ensure Java and your build tool are installed remotely, e.g. using
250-
a `pre_build` hook (Java and Maven are installed by default, Gradle is not)
251-
251+
1. Ensure Java and your build tool are installed remotely, e.g. using a `pre_build` hook
252+
(Java and Maven are installed by default, Gradle is not)
252253
2. Use a `build` hook to build your jar (using Maven or Gradle), e.g.
253254
+
255+
[indent=0]
254256
----
255-
#!/bin/bash
256-
cd $OPENSHIFT_REPO_DIR
257-
mvn package -s .openshift/settings.xml -DskipTests=true
257+
#!/bin/bash
258+
cd $OPENSHIFT_REPO_DIR
259+
mvn package -s .openshift/settings.xml -DskipTests=true
258260
----
259261
+
260262
3. Add a `start` hook that calls `java -jar ...`
261263
+
264+
[indent=0]
262265
----
263-
#!/bin/bash
264-
cd $OPENSHIFT_REPO_DIR
265-
nohup java -jar target/*.jar --server.port=${OPENSHIFT_DIY_PORT} --server.address=${OPENSHIFT_DIY_IP} &
266+
#!/bin/bash
267+
cd $OPENSHIFT_REPO_DIR
268+
nohup java -jar target/*.jar --server.port=${OPENSHIFT_DIY_PORT} --server.address=${OPENSHIFT_DIY_IP} &
266269
----
267270
+
268271
4. Use a `stop` hook (since the start is supposed to return cleanly), e.g.
269272
+
273+
[indent=0]
270274
----
271-
#!/bin/bash
272-
source $OPENSHIFT_CARTRIDGE_SDK_BASH
273-
PID=$(ps -ef | grep java.*\.jar | grep -v grep | awk '{ print $2 }')
274-
if [ -z "$PID" ]
275-
then
276-
client_result "Application is already stopped"
277-
else
278-
kill $PID
279-
fi
275+
#!/bin/bash
276+
source $OPENSHIFT_CARTRIDGE_SDK_BASH
277+
PID=$(ps -ef | grep java.*\.jar | grep -v grep | awk '{ print $2 }')
278+
if [ -z "$PID" ]
279+
then
280+
client_result "Application is already stopped"
281+
else
282+
kill $PID
283+
fi
280284
----
281285
+
282286
5. Embed service bindings from environment variables provided by the platform
283287
in your `application.properties`, e.g.
284288
+
289+
[indent=0]
285290
----
286-
spring.datasource.url: jdbc:mysql://${OPENSHIFT_MYSQL_DB_HOST}:${OPENSHIFT_MYSQL_DB_PORT}/${OPENSHIFT_APP_NAME}
287-
spring.datasource.username: ${OPENSHIFT_MYSQL_DB_USERNAME}
288-
spring.datasource.password: ${OPENSHIFT_MYSQL_DB_PASSWORD}
291+
spring.datasource.url: jdbc:mysql://${OPENSHIFT_MYSQL_DB_HOST}:${OPENSHIFT_MYSQL_DB_PORT}/${OPENSHIFT_APP_NAME}
292+
spring.datasource.username: ${OPENSHIFT_MYSQL_DB_USERNAME}
293+
spring.datasource.password: ${OPENSHIFT_MYSQL_DB_PASSWORD}
289294
----
290295

291-
There's a blog on https://www.openshift.com/blogs/run-gradle-builds-on-openshift[running Gradle
292-
in Openshift] on their website that will get you started with a gradle build to run
293-
the app. A http://issues.gradle.org/browse/GRADLE-2871[bug in Gradle] currently prevents you
294-
from using Gradle newer than 1.6.
296+
There's a blog on https://www.openshift.com/blogs/run-gradle-builds-on-openshift[running
297+
Gradle in Openshift] on their website that will get you started with a gradle build to
298+
run the app. A http://issues.gradle.org/browse/GRADLE-2871[bug in Gradle] currently
299+
prevents you from using Gradle newer than 1.6.
300+
301+
295302

296303
[[cloud-deployment-whats-next]]
297304
== What to read next

spring-boot-docs/src/main/asciidoc/production-ready-features.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Auditing, health and metrics gathering can be automatically applied to your appl
1313

1414
[[production-ready-enabling]]
1515
== Enabling production-ready features.
16-
The https://github.com/spring-projects/spring-boot/tree/master/spring-boot-actuator[`spring-boot-actuator`] module provides all of Spring Boot's production-ready
17-
features. The simplest way to enable the features is to add a dependency to the
18-
`spring-boot-starter-actuator` ``Starter POM''.
16+
The {github-code}/spring-boot-actuator[`spring-boot-actuator`] module provides all of
17+
Spring Boot's production-ready features. The simplest way to enable the features is to add
18+
a dependency to the `spring-boot-starter-actuator` ``Starter POM''.
1919

2020
.Definition of Actuator
2121
****

0 commit comments

Comments
 (0)