Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Updated for Spring Cloud 1.0. Added demo script.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottfrederick committed Jun 18, 2014
1 parent 8816666 commit 5e7ec49
Show file tree
Hide file tree
Showing 7 changed files with 847 additions and 26 deletions.
22 changes: 22 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
= Building a Cloud-ready Microservice

This repository contains a link:demo-script.adoc[script] for demonstrating the construction of a REST microservice using Spring Boot, Spring Data, and Spring Cloud, and deploying the microservice to Cloud Foundry.

The repository also contains the completed example, ready for deployment to Cloud Foundry.

To build and deploy the completed application, you will need to:

* install http://www.gradle.org/installation[Gradle]
* install the http://docs.cloudfoundry.org/devguide/installcf/install-go-cli.html[Cloud Foundry CLI]
* use the Cloud Foundry CLI to http://docs.cloudfoundry.org/devguide/installcf/whats-new-v6.html#login[log into your Cloud Foundry system]
Once these prerequisites are met, you can follow these steps to build and deploy the microservice to Cloud Foundry:

[source,bash]
----
$ gradle assemble
$ cf create-service p-mysql 100mb-dev cities-db
$ cf push --random-route
----

See the link:demo-script.adoc[script] for additional information on using and testing the microservice.
4 changes: 0 additions & 4 deletions README.md

This file was deleted.

23 changes: 7 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.0.2.RELEASE")
classpath("org.cloudfoundry:cf-gradle-plugin:1.0.2")
classpath("org.cloudfoundry:cf-gradle-plugin:1.0.3")
}
}

Expand All @@ -19,17 +19,13 @@ repositories {
maven { url "http://repo.spring.io/milestone" }
}

ext {
springCloudVersion = "0.9.8"
}

dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("org.springframework.data:spring-data-rest-webmvc")
compile("org.springframework.cloud:spring-service-connector:${springCloudVersion}")
compile("org.springframework.cloud:cloudfoundry-connector:${springCloudVersion}")
compile("org.springframework.boot:spring-boot-starter-data-rest")
compile("org.springframework.cloud:spring-cloud-spring-service-connector:1.0.0.RELEASE")
compile("org.springframework.cloud:spring-cloud-cloudfoundry-connector:1.0.0.RELEASE")
runtime("org.hsqldb:hsqldb")
runtime("mysql:mysql-connector-java:5.1.25")

Expand All @@ -40,25 +36,20 @@ task wrapper(type: Wrapper) {
gradleVersion = '1.12'
}

tasks."cf-push".dependsOn assemble
tasks.cfPush.dependsOn assemble

cloudfoundry {
target = "https://api.cf.scottfrederick.io"
target = "https://api.cf.mycloud.com"
space = "development"

application = "cities"
file = file("${jar.archivePath}")
host = "cities"
domain = "apps.scottfrederick.io"
memory = 512
instances = 1

trustSelfSignedCerts = true

services {
"cities-db" {
label = "p-mysql"
plan = "100mb"
plan = "100mb-dev"
}
}
}
Loading

0 comments on commit 5e7ec49

Please sign in to comment.