From f8fd74e616b3a47ad2382701638e16c8b1eb3941 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Mon, 18 Jun 2018 18:42:39 -0400 Subject: [PATCH] Added docs on deploying SCT apps to CF --- .../main/asciidoc/appendix-cloud-foundry.adoc | 34 +++++++++++++++++++ .../src/main/asciidoc/appendix.adoc | 1 + 2 files changed, 35 insertions(+) create mode 100644 spring-cloud-task-docs/src/main/asciidoc/appendix-cloud-foundry.adoc diff --git a/spring-cloud-task-docs/src/main/asciidoc/appendix-cloud-foundry.adoc b/spring-cloud-task-docs/src/main/asciidoc/appendix-cloud-foundry.adoc new file mode 100644 index 00000000..f9b45399 --- /dev/null +++ b/spring-cloud-task-docs/src/main/asciidoc/appendix-cloud-foundry.adoc @@ -0,0 +1,34 @@ + +[[appendix-cloud-foundry]] +== Running a Task App on Cloud Foundry + +This section will discuss how to deploy a Spring Cloud Task application onto +the Cloud Foundry platform. + +There are 3 steps to deploying your Spring Cloud Task application: + +. We must push your application to the platform using the `cf push command`. +This command pushes your jar to the Cloud Foundry platform. + +. We need to stop the application from running once the push is complete. +Cloud Foundry has to run the application to stage it. But when Cloud Foundry +runs the application at this time it is treating the application as a LRP (Long Running Process) +which means once the task is complete it will restart it. This is not the desired +behavior for our task, thus we must stop it from running. To stop the LRP execution, +we will use the `cf stop` command. + +. We now need to launch our application as a task to do this we will use +the `cf run-task` command. + +NOTE: When using the run-task command you have to specify build pack to be used +and that is specified in the `command string` enumerated below. + +[source,bash] +``` +$ cf push --health-check-type none -p --no-route +$ cf stop +$ cf run-task +``` + +For further examples and how to's on using the Cloud Foundry CLI click +https://docs.cloudfoundry.org/cf-cli/getting-started.html[here]. \ No newline at end of file diff --git a/spring-cloud-task-docs/src/main/asciidoc/appendix.adoc b/spring-cloud-task-docs/src/main/asciidoc/appendix.adoc index 34185ba3..3d0ac9d9 100644 --- a/spring-cloud-task-docs/src/main/asciidoc/appendix.adoc +++ b/spring-cloud-task-docs/src/main/asciidoc/appendix.adoc @@ -4,3 +4,4 @@ include::appendix-task-repository-schema.adoc[] include::appendix-building-the-documentation.adoc[] +include::appendix-cloud-foundry.adoc[]