|
|
|
@ -30,66 +30,104 @@ developed>> in the ``Getting Started'' section up and running in the Cloud. |
|
|
|
[[cloud-deployment-cloud-foundry]] |
|
|
|
[[cloud-deployment-cloud-foundry]] |
|
|
|
== Cloud Foundry |
|
|
|
== Cloud Foundry |
|
|
|
Cloud Foundry provides default buildpacks that come into play if no other buildpack is |
|
|
|
Cloud Foundry provides default buildpacks that come into play if no other buildpack is |
|
|
|
specified. The Cloud Foundry buildpack has excellent support for Spring applications, |
|
|
|
specified. The Cloud Foundry Java buildpack has excellent support for Spring applications, |
|
|
|
including Spring Boot. You can deploy stand-alone executable jar applications, as well as |
|
|
|
including Spring Boot. You can deploy stand-alone executable jar applications, as well as |
|
|
|
traditional `war` packaged applications. |
|
|
|
traditional `.war` packaged applications. |
|
|
|
|
|
|
|
|
|
|
|
Once you've built your application (using, for example, `mvn clean install`) and |
|
|
|
Once you've built your application (using, for example, `mvn clean install`) and |
|
|
|
http://docs.cloudfoundry.org/devguide/installcf/[installed the `cf` command line tool], |
|
|
|
http://docs.run.pivotal.io/devguide/installcf/install-go-cli.html/[installed the `cf` |
|
|
|
simply answer the `cf push` command's prompts as follows: |
|
|
|
command line tool], simply answer the `cf push` command prompts as follows, substituting |
|
|
|
|
|
|
|
the path to your compiled `.jar` for mine. Be sure to have |
|
|
|
|
|
|
|
http://docs.run.pivotal.io/devguide/installcf/whats-new-v6.html#login[logged in with your |
|
|
|
|
|
|
|
`cf` command line client] before attempting to use it. |
|
|
|
|
|
|
|
|
|
|
|
[indent=0,subs="verbatim,quotes,attributes"] |
|
|
|
[indent=0,subs="verbatim,quotes,attributes"] |
|
|
|
---- |
|
|
|
---- |
|
|
|
$ cf push --path target/demo-0.0.1-SNAPSHOT.jar |
|
|
|
$ cf push --path target/demo-0.0.1-SNAPSHOT.jar |
|
|
|
|
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If there is a Cloud Foundry `manifest.yml` file present in the same directory, it will be |
|
|
|
|
|
|
|
consulted. If not, the client will prompt you with questions it has about how it should |
|
|
|
|
|
|
|
deploy and manage your application, starting with its name: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[indent=0,subs="verbatim,quotes,attributes"] |
|
|
|
|
|
|
|
---- |
|
|
|
|
|
|
|
Name> *acloudyspringtime* |
|
|
|
|
|
|
|
|
|
|
|
Name> *_$YOURAPP_* |
|
|
|
|
|
|
|
Instances> *1* |
|
|
|
Instances> *1* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1: 128M |
|
|
|
|
|
|
|
2: 256M |
|
|
|
|
|
|
|
3: 512M |
|
|
|
|
|
|
|
4: 1G |
|
|
|
Memory Limit> *256M* |
|
|
|
Memory Limit> *256M* |
|
|
|
|
|
|
|
|
|
|
|
Creating _$YOURAPP_... *OK* |
|
|
|
Creating acloudyspringtime... *OK* |
|
|
|
|
|
|
|
|
|
|
|
1: _$YOURAPP_ |
|
|
|
1: acloudyspringtime |
|
|
|
2: none |
|
|
|
2: none |
|
|
|
Subdomain> *_$YOURAPP_* |
|
|
|
Subdomain> *acloudyspringtime* |
|
|
|
|
|
|
|
|
|
|
|
1: cfapps.io |
|
|
|
1: cfapps.io |
|
|
|
2: none |
|
|
|
2: none |
|
|
|
Domain> *cfapps.io* |
|
|
|
Domain> *cfapps.io* |
|
|
|
|
|
|
|
|
|
|
|
Creating route _$YOURAPP_.cfapps.io... OK |
|
|
|
Creating route acloudyspringtime.cfapps.io... *OK* |
|
|
|
Binding _$YOURAPP_.cfapps.io to _$YOURAPP_... OK |
|
|
|
Binding acloudyspringtime.cfapps.io to acloudyspringtime... *OK* |
|
|
|
|
|
|
|
|
|
|
|
Create services for application?> *n* |
|
|
|
Create services for application?> *n* |
|
|
|
|
|
|
|
|
|
|
|
Bind other services to application?> *n* |
|
|
|
Bind other services to application?> *n* |
|
|
|
|
|
|
|
|
|
|
|
Save configuration?> *y* |
|
|
|
Save configuration?> *y* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Saving to manifest.yml... *OK* |
|
|
|
---- |
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NOTE: Here we are substituting `acloudyspringtime` for whatever value you give `cf` when |
|
|
|
|
|
|
|
it asks for the `name` of your application. |
|
|
|
|
|
|
|
|
|
|
|
At this point `cf` will start uploading your application: |
|
|
|
At this point `cf` will start uploading your application: |
|
|
|
|
|
|
|
|
|
|
|
[indent=0,subs="verbatim,quotes,attributes"] |
|
|
|
[indent=0,subs="verbatim,quotes,attributes"] |
|
|
|
---- |
|
|
|
---- |
|
|
|
Saving to manifest.yml... *OK* |
|
|
|
Uploading acloudyspringtime... *OK* |
|
|
|
Uploading $YOURAPP... *OK* |
|
|
|
Preparing to start acloudyspringtime... *OK* |
|
|
|
Preparing to start _$YOURAPP_... *OK* |
|
|
|
-----> Downloaded app package (*8.9M*) |
|
|
|
-----> Downloaded app package (8.7M) |
|
|
|
|
|
|
|
-----> Java Buildpack source: system |
|
|
|
-----> Java Buildpack source: system |
|
|
|
-----> Downloading Open JDK 1.7.0_51 from .../openjdk-1.7.0_51.tar.gz (*1.4s*) |
|
|
|
-----> Downloading Open JDK 1.7.0_51 from .../x86_64/openjdk-1.7.0_51.tar.gz (*1.8s*) |
|
|
|
Expanding Open JDK to .java-buildpack/open_jdk (*1.3s*) |
|
|
|
Expanding Open JDK to .java-buildpack/open_jdk (*1.2s*) |
|
|
|
-----> Downloading Spring Auto Reconfiguration 0.8.7 from .../auto-reconfiguration-0.8.7.jar (*0.0s*) |
|
|
|
-----> Downloading Spring Auto Reconfiguration from 0.8.7 .../auto-reconfiguration-0.8.7.jar (*0.1s*) |
|
|
|
-----> Uploading droplet (*43M*) |
|
|
|
-----> Uploading droplet (*44M*) |
|
|
|
Checking status of app '_$YOURAPP_'... |
|
|
|
Checking status of app 'acloudyspringtime'... |
|
|
|
0 of 1 instances running (1 starting) |
|
|
|
0 of 1 instances running (1 starting) |
|
|
|
0 of 1 instances running (1 starting) |
|
|
|
... |
|
|
|
1 of 1 instances running (1 running) |
|
|
|
0 of 1 instances running (1 down) |
|
|
|
Push successful! App '_$YOURAPP_' available at http://_$YOURAPP_.cfapps.io |
|
|
|
... |
|
|
|
|
|
|
|
0 of 1 instances running (1 starting) |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
1 of 1 instances running (1 running) |
|
|
|
|
|
|
|
Push successful! App \'acloudyspringtime' available at acloudyspringtime.cfapps.io |
|
|
|
---- |
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
NOTE: Here we are substituting `$YOURAPP` for whatever value you give `cf` when it asks |
|
|
|
Congratulations! The application is now live! |
|
|
|
for the `name` of your application. |
|
|
|
|
|
|
|
|
|
|
|
It's easy to then verify the status of the deployed application: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[indent=0,subs="verbatim,quotes,attributes"] |
|
|
|
|
|
|
|
---- |
|
|
|
|
|
|
|
$ cf apps |
|
|
|
|
|
|
|
Getting applications in ... OK |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name status usage url |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
acloudyspringtime running 1 x 256M acloudyspringtime.cfapps.io |
|
|
|
|
|
|
|
... |
|
|
|
|
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
Once Cloud Foundry acknowledges that your application has been deployed, you should be |
|
|
|
Once Cloud Foundry acknowledges that your application has been deployed, you should be |
|
|
|
able to hit the application at the URI provided: |
|
|
|
able to hit the application at the URI given, in this case |
|
|
|
`http://$YOURAPP.cfapps.io/`. |
|
|
|
`http://acloudyspringtime.cfapps.io/`. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|