diff --git a/spring-cloud-cloudfoundry/1.0.0.RELEASE/ghpages.sh b/spring-cloud-cloudfoundry/1.0.0.RELEASE/ghpages.sh new file mode 100644 index 00000000..e1063ce3 --- /dev/null +++ b/spring-cloud-cloudfoundry/1.0.0.RELEASE/ghpages.sh @@ -0,0 +1,54 @@ +#!/bin/bash -x + +git remote set-url --push origin `git config remote.origin.url | sed -e 's/^git:/https:/'` + +if ! (git remote set-branches --add origin gh-pages && git fetch -q); then + echo "No gh-pages, so not syncing" + exit 0 +fi + +if ! [ -d docs/target/generated-docs ]; then + echo "No gh-pages sources in docs/target/generated-docs, so not syncing" + exit 0 +fi + +# Find name of current branch +################################################################### +branch=$TRAVIS_BRANCH +[ "$branch" == "" ] && branch=`git rev-parse --abbrev-ref HEAD` +target=. +if [ "$branch" != "master" ]; then target=./$branch; mkdir -p $target; fi + +# Stash any outstanding changes +################################################################### +git diff-index --quiet HEAD +dirty=$? +if [ "$dirty" != "0" ]; then git stash; fi + +# Switch to gh-pages branch to sync it with current branch +################################################################### +git checkout gh-pages + +for f in docs/target/generated-docs/*; do + file=${f#docs/target/generated-docs/*} + if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then + # Not ignored... + cp -rf $f $target + git add -A $target/$file + fi +done + +git add -A README.adoc || echo "No change to README.adoc" +git commit -a -m "Sync docs from $branch to gh-pages" || echo "Nothing committed" + +# Uncomment the following push if you want to auto push to +# the gh-pages branch whenever you commit to branch locally. +# This is a little extreme. Use with care! +################################################################### +git push origin gh-pages || echo "Cannot push gh-pages" + +# Finally, switch back to the current branch and exit block +git checkout $branch +if [ "$dirty" != "0" ]; then git stash pop; fi + +exit 0 diff --git a/spring-cloud-cloudfoundry/1.0.0.RELEASE/index.html b/spring-cloud-cloudfoundry/1.0.0.RELEASE/index.html new file mode 100644 index 00000000..a2db7377 --- /dev/null +++ b/spring-cloud-cloudfoundry/1.0.0.RELEASE/index.html @@ -0,0 +1,537 @@ + + + + + + + +Spring Cloud for Cloud Foundry + + + + + +
+
+
+
+

Spring Cloud for Cloudfoundry makes it easy to run +Spring Cloud apps in +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).

+
+
+

The spring-cloud-cloudfoundry-web project provides basic support for +some enhanced features of webapps in Cloud Foundry: binding +automatically to single-sign-on services and optionally enabling +sticky routing for discovery.

+
+
+

The spring-cloud-cloudfoundry-discovery project provides an +implementation of Spring Cloud Commons DiscoveryClient so you can +@EnableDiscoveryClient and provide your credentials as +spring.cloud.cloudfoundry.discovery.[email,password] and then you +can use the DiscoveryClient directly or via a LoadBalancerClient +(also *.url if you are not connecting to +Pivotal Web Services).

+
+
+

The first time you use it the discovery client might be slow owing to +the fact that it has to get an access token from Cloud Foundry.

+
+
+
+
+

Discovery

+
+
+

Here’s a Spring Cloud app with Cloud Foundry discovery:

+
+
+
app.groovy
+
+
@Grab('org.springframework.cloud:spring-cloud-cloudfoundry')
+@RestController
+@EnableDiscoveryClient
+class Application {
+
+  @Autowired
+  DiscoveryClient client
+
+  @RequestMapping('/')
+  String home() {
+    'Hello from ' + client.getLocalServiceInstance()
+  }
+
+}
+
+
+
+

If you run it without any service bindings:

+
+
+
+
$ spring jar app.jar app.groovy
+$ cf push -p app.jar
+
+
+
+

It will show its app name in the home page.

+
+
+

The DiscoveryClient can lists all the apps in a space, according to +the credentials it is authenticated with, where the space defaults to +the one the client is running in (if any). If neither org nor space +are configured, they default per the user’s profile in Cloud Foundry.

+
+
+
+
+

Single Sign On

+
+
+ + + + + +
+
Note
+
+All of the OAuth2 SSO and resource server features moved to Spring Boot +in version 1.3. You can find documentation in the +Spring Boot user guide. +
+
+
+

This project provides automatic binding from CloudFoundry service +credentials to the Spring Boot features. If you have a CloudFoundry +service called "sso", for instance, with credentials containing +"client_id", "client_secret" and "auth_domain", it will bind +automatically to the Spring OAuth2 client that you enable with +@EnableOAuth2Sso (from Spring Boot). The name of the service can be +parameterized using spring.oauth2.sso.serviceId.

+
+
+
+
+ + + \ No newline at end of file