Update docs with RC1 labels

This commit is contained in:
Dave Syer
2014-12-19 15:50:58 +00:00
parent 5c614384a5
commit 31288debbd

View File

@@ -1,71 +1,17 @@
// Do not edit this file (e.g. go instead to src/main/asciidoc)
Integration between https://github.com/cloudfoundry[Cloud Foundry]
and https://github.com/spring-cloud[Spring Cloud].
Spring Cloud for Cloudfoundry makes it easy to run
https://github.com/spring-cloud[Spring Cloud] apps in
https://github.com/cloudfoundry[Cloud Foundry] (the Platform as a
Service). Cloud Foundry has the notion of a "service", which is
middlware that you "bind" to an app, essentially providing it with an
environment variable containing credentials (e.g. the location and
username to use for the service).
== Service Broker Example
Example script to deploy and register a broker:
```
DOMAIN=mydomain.net
cf push app -p target/*.jar --no-start
cf env app | grep SPRING_PROFILES_ACTIVE || cf set-env app SPRING_PROFILES_ACTIVE cloud
cf env app | grep APPLICATION_DOMAIN || cf set-env app APPLICATION_DOMAIN ${DOMAIN}
cf services | grep configserver && cf bind app configserver
cf restart app
cf create-service-broker app user secure http://app.${DOMAIN}
for f in `cf curl /v2/service_plans | grep '\"guid' | sed -e 's/.*: "//' -e 's/".*//'`; do
cf curl v2/service_plans/$f -X PUT -d '{"public":true}'
done
cf create-service app free appi
```
At which point you have a service called "app" and a service instance called "appi":
```
$ cf marketplace
OK
service plans description
app free Singleton service app
$ cf services
Getting services in org default / space development as admin...
OK
name service plan bound apps
appi app free
```
Your application can define a configuration property
`application.domain` (defaults to "cfapps.io") which will be used to
construct the credentials for any app that binds to your service. Or
it can define the URI directly using
`cloudfoundry.service.definition.metadata.uri`.
You can change some other basic metadata by setting config properties:
* `cloudfoundry.service.definition.*` is bound to a
`ServiceDefinition` (defined in spring-boot-cf-service-broker) which
has optional setters for plans and metadata.
* `cloudfoundry.service.broker.*` is bound to an internal bean. It has
optional setters for "name" (the service name), "description" (user
friendly description) and "prefix" (used to create a unique id from
the name).
An app which binds to your service will get credentials that contain a
"uri" property linking to your service. A Spring Boot app can bind to
that through the `vcap.services.[service].credentials.uri` environment
property.
If your service also has a
https://github.com/Netflix/eureka[Eureka core] dependency, and you
can expose it as a Eureka service, then any service which registers
with Eureka will also become a Cloud Foundry service.
Add this project as a dependency to any Spring Cloud UI app or REST
service and deploy to Cloudfoundry. If you use Spring Cloud Security
OAuth2 features this will make them bindable to Cloud Foundry services
instead of enironment properties in `oauth2.*`. For a UI app you can
declare `@EnableOAuth2Sso` and bind to a service called "sso", and for
a service you can add `@EnableOAuth2Resource` and bind to a service
called "resource" (see below for how to change the names).