From 4a4c5b797cbc0d61533b78958f66d3e7eb1685fd Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Wed, 7 Feb 2018 16:13:31 -0500 Subject: [PATCH 01/31] bumping spring-cloud-build version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2c815063..becdac96 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 1.3.6.RELEASE + 1.3.8.RELEASE From e04b0821ee444eca166a9fb6dd5984d10c121104 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Wed, 7 Feb 2018 16:14:00 -0500 Subject: [PATCH 02/31] bumping spring-cloud-dependencies-parent --- spring-cloud-config-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 6239dc6b..c35874ea 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -5,7 +5,7 @@ spring-cloud-dependencies-parent org.springframework.cloud - 1.3.6.RELEASE + 1.3.8.RELEASE spring-cloud-config-dependencies From 339ba7a2911de1876c075f35089d508700d39c15 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Wed, 7 Feb 2018 16:38:24 -0500 Subject: [PATCH 03/31] using snapshot --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index becdac96..5f1d7726 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 1.3.8.RELEASE + 1.3.8.BUILD-SNAPSHOT From 9ae99cf48a9e057f06972a59b4c074490ceec5d3 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Wed, 7 Feb 2018 16:38:53 -0500 Subject: [PATCH 04/31] using snapshot --- spring-cloud-config-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index c35874ea..82160c8e 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -5,7 +5,7 @@ spring-cloud-dependencies-parent org.springframework.cloud - 1.3.8.RELEASE + 1.3.8.BUILD-SNAPSHOT spring-cloud-config-dependencies From cc33b3e4f88c06804334f9eddee6c5c8f0e6402c Mon Sep 17 00:00:00 2001 From: buildmaster Date: Thu, 8 Feb 2018 14:36:02 +0000 Subject: [PATCH 05/31] Update SNAPSHOT to 1.4.2.RELEASE --- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 4 ++-- spring-cloud-config-monitor/pom.xml | 4 ++-- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 025059ff..a58ae440 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.2.RELEASE .. diff --git a/pom.xml b/pom.xml index 5f1d7726..5acc46d6 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.2.RELEASE pom Spring Cloud Config Spring Cloud Config @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 1.3.8.BUILD-SNAPSHOT + 1.3.8.RELEASE @@ -22,7 +22,7 @@ config - 1.3.0.RELEASE + 1.3.2.RELEASE spring-cloud-config-dependencies diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index fc500283..6829ed2d 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.2.RELEASE .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 82160c8e..54d770cb 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -5,11 +5,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 1.3.8.BUILD-SNAPSHOT + 1.3.8.RELEASE spring-cloud-config-dependencies - 1.4.2.BUILD-SNAPSHOT + 1.4.2.RELEASE pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index 38cf62b4..1b36abcd 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.2.RELEASE .. spring-cloud-config-monitor @@ -13,7 +13,7 @@ Spring Cloud Config Monitor ${basedir}/../.. - 1.3.2.RELEASE + 1.3.3.RELEASE diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index c93c6f84..a041c7a5 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.2.RELEASE .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index e9f3da48..9da0423d 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.2.RELEASE .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index f0b26baa..e1487194 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -5,10 +5,10 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.2.RELEASE spring-cloud-starter-config - 1.4.2.BUILD-SNAPSHOT + 1.4.2.RELEASE spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From 7376c1056c71ec2e7c441d453472e1e25b694ae5 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Thu, 8 Feb 2018 14:37:17 +0000 Subject: [PATCH 06/31] Going back to snapshots --- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 4 ++-- spring-cloud-config-monitor/pom.xml | 4 ++-- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index a58ae440..025059ff 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.RELEASE + 1.4.2.BUILD-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 5acc46d6..5f1d7726 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 1.4.2.RELEASE + 1.4.2.BUILD-SNAPSHOT pom Spring Cloud Config Spring Cloud Config @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 1.3.8.RELEASE + 1.3.8.BUILD-SNAPSHOT @@ -22,7 +22,7 @@ config - 1.3.2.RELEASE + 1.3.0.RELEASE spring-cloud-config-dependencies diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index 6829ed2d..fc500283 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.RELEASE + 1.4.2.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 54d770cb..82160c8e 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -5,11 +5,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 1.3.8.RELEASE + 1.3.8.BUILD-SNAPSHOT spring-cloud-config-dependencies - 1.4.2.RELEASE + 1.4.2.BUILD-SNAPSHOT pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index 1b36abcd..38cf62b4 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.RELEASE + 1.4.2.BUILD-SNAPSHOT .. spring-cloud-config-monitor @@ -13,7 +13,7 @@ Spring Cloud Config Monitor ${basedir}/../.. - 1.3.3.RELEASE + 1.3.2.RELEASE diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index a041c7a5..c93c6f84 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.RELEASE + 1.4.2.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index 9da0423d..e9f3da48 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.RELEASE + 1.4.2.BUILD-SNAPSHOT .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index e1487194..f0b26baa 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -5,10 +5,10 @@ org.springframework.cloud spring-cloud-config - 1.4.2.RELEASE + 1.4.2.BUILD-SNAPSHOT spring-cloud-starter-config - 1.4.2.RELEASE + 1.4.2.BUILD-SNAPSHOT spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From 1dc72f93ac4af849f5267fe77f45314bee03de44 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Thu, 8 Feb 2018 14:37:18 +0000 Subject: [PATCH 07/31] Bumping versions to 1.4.3.BUILD-SNAPSHOT after release --- docs/pom.xml | 2 +- pom.xml | 4 ++-- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 2 +- spring-cloud-config-monitor/pom.xml | 2 +- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 025059ff..39c6255e 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.3.BUILD-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 5f1d7726..0d4a609a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.3.BUILD-SNAPSHOT pom Spring Cloud Config Spring Cloud Config @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-build - 1.3.8.BUILD-SNAPSHOT + 1.3.8.RELEASE diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index fc500283..346cf905 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.3.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 82160c8e..44245d9e 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -9,7 +9,7 @@ spring-cloud-config-dependencies - 1.4.2.BUILD-SNAPSHOT + 1.4.3.BUILD-SNAPSHOT pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index 38cf62b4..63a2cecc 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -5,7 +5,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.3.BUILD-SNAPSHOT .. spring-cloud-config-monitor diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index c93c6f84..a78861cb 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.3.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index e9f3da48..d11fa08f 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -12,7 +12,7 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.3.BUILD-SNAPSHOT .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index f0b26baa..03efa57a 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -5,10 +5,10 @@ org.springframework.cloud spring-cloud-config - 1.4.2.BUILD-SNAPSHOT + 1.4.3.BUILD-SNAPSHOT spring-cloud-starter-config - 1.4.2.BUILD-SNAPSHOT + 1.4.3.BUILD-SNAPSHOT spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From d0fb716d1850d4a74538b5f04b4668777d0951dc Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Mon, 12 Feb 2018 11:30:56 -0500 Subject: [PATCH 08/31] Remove brixton reference --- README.adoc | 372 ++++--------------------- docs/src/main/asciidoc/quickstart.adoc | 4 +- 2 files changed, 62 insertions(+), 314 deletions(-) diff --git a/README.adoc b/README.adoc index 1c1402d1..ea497299 100644 --- a/README.adoc +++ b/README.adoc @@ -1,339 +1,44 @@ // Do not edit this file (e.g. go instead to src/main/asciidoc) -image::https://circleci.com/gh/spring-cloud/spring-cloud-config/tree/master.svg?style=svg["CircleCI", link="https://circleci.com/gh/spring-cloud/spring-cloud-config/tree/master"] -image::https://codecov.io/gh/spring-cloud/spring-cloud-config/branch/master/graph/badge.svg["Codecov", link="https://codecov.io/gh/spring-cloud/spring-cloud-config/branch/master"] -image::https://api.codacy.com/project/badge/Grade/f064024a072c477e97dca6ed5a70fccd?branch=master["Codacy code quality", link="https://www.codacy.com/app/Spring-Cloud/spring-cloud-config?branch=master&utm_source=github.com&utm_medium=referral&utm_content=spring-cloud/spring-cloud-config&utm_campaign=Badge_Grade"] +image:https://circleci.com/gh/spring-cloud/spring-cloud-build.svg?style=svg[link="https://travis-ci.org/spring-cloud/spring-cloud-build"] +Spring Cloud Build is a common utility project for Spring Cloud +to use for plugin and dependency management. -Spring Cloud Config provides server and client-side support for externalized configuration in a distributed system. With the Config Server you have a central place to manage external properties for applications across all environments. The concepts on both client and server map identically to the Spring `Environment` and `PropertySource` abstractions, so they fit very well with Spring applications, but can be used with any application running in any language. As an application moves through the deployment pipeline from dev to test and into production you can manage the configuration between those environments and be certain that applications have everything they need to run when they migrate. The default implementation of the server storage backend uses git so it easily supports labelled versions of configuration environments, as well as being accessible to a wide range of tooling for managing the content. It is easy to add alternative implementations and plug them in with Spring configuration. +== Building and Deploying - -== Features - -=== Spring Cloud Config Server - -* HTTP, resource-based API for external configuration (name-value pairs, or equivalent YAML content) -* Encrypt and decrypt property values (symmetric or asymmetric) -* Embeddable easily in a Spring Boot application using `@EnableConfigServer` - -=== Spring Cloud Config Client - -Specifically for Spring applications: - -* Bind to the Config Server and initialize Spring `Environment` with remote property sources -* Encrypt and decrypt property values (symmetric or asymmetric) -* `@RefreshScope` for Spring `@Beans` that want to be re-initialized when configuration changes -* Management endpoints: -** `/env` for updating `Environment` and rebinding `@ConfigurationProperties` and log levels -** `/refresh` for refreshing the `@RefreshScope` beans -** `/restart` for restarting the Spring context (disabled by default) -** `/pause` and `/resume` for calling the `Lifecycle` methods (`stop()` and `start()` on the `ApplicationContext`) -* Bootstrap application context: a parent context for the main application that can be trained to do anything (by default it binds to the Config Server, and decrypts property values) - -== Quick Start - -Start the server: +To install locally: ---- -$ cd spring-cloud-config-server -$ ../mvnw spring-boot:run + +$ mvn install -s .settings.xml ---- -The server is a Spring Boot application so you can run it from your -IDE instead if you prefer (the main class is -`ConfigServerApplication`). Then try out a client: +and to deploy snapshots to repo.spring.io: ---- -$ curl localhost:8888/foo/development -{"name":"development","label":"master","propertySources":[ - {"name":"https://github.com/scratches/config-repo/foo-development.properties","source":{"bar":"spam"}}, - {"name":"https://github.com/scratches/config-repo/foo.properties","source":{"foo":"bar"}} -]} +$ mvn deploy -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local ---- -The default strategy for locating property sources is to clone a git -repository (at `spring.cloud.config.server.git.uri`) and use it to -initialize a mini `SpringApplication`. The mini-application's -`Environment` is used to enumerate property sources and publish them -via a JSON endpoint. - -The HTTP service has resources in the form: +for a RELEASE build use ---- -/{application}/{profile}[/{label}] -/{application}-{profile}.yml -/{label}/{application}-{profile}.yml -/{application}-{profile}.properties -/{label}/{application}-{profile}.properties +$ mvn deploy -DaltReleaseDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-release-local ---- -where the "application" is injected as the `spring.config.name` in the -`SpringApplication` (i.e. what is normally "application" in a regular -Spring Boot app), "profile" is an active profile (or comma-separated -list of properties), and "label" is an optional git label (defaults to -"master".) - -Spring Cloud Config Server pulls configuration for remote clients -from a git repository (which must be provided): - -[source,yaml] ----- -spring: - cloud: - config: - server: - git: - uri: https://github.com/spring-cloud-samples/config-repo ----- - -=== Client Side Usage - -To use these features in an application, just build it as a Spring -Boot application that depends on spring-cloud-config-client (e.g. see -the test cases for the config-client, or the sample app). The most -convenient way to add the dependency is via a Spring Boot starter -`org.springframework.cloud:spring-cloud-starter-config`. There is also a -parent pom and BOM (`spring-cloud-starter-parent`) for Maven users and a -Spring IO version management properties file for Gradle and Spring CLI -users. Example Maven configuration: - -[source,xml,indent=0] -.pom.xml ----- - - org.springframework.boot - spring-boot-starter-parent - 1.3.5.RELEASE - - - - - - - org.springframework.cloud - spring-cloud-dependencies - Brixton.RELEASE - pom - import - - - - - - - org.springframework.cloud - spring-cloud-starter-config - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - ----- - -Then you can create a standard Spring Boot application, like this simple HTTP server: +and for jcenter use ---- -@SpringBootApplication -@RestController -public class Application { - - @RequestMapping("/") - public String home() { - return "Hello World!"; - } - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} +$ mvn deploy -DaltReleaseDeploymentRepository=bintray::default::https://api.bintray.com/maven/spring/jars/org.springframework.cloud:build ---- -When it runs it will pick up the external configuration from the -default local config server on port 8888 if it is running. To modify -the startup behaviour you can change the location of the config server -using `bootstrap.properties` (like `application.properties` but for -the bootstrap phase of an application context), e.g. +and for Maven Central use ---- -spring.cloud.config.uri: http://myconfigserver.com +$ mvn deploy -P central -DaltReleaseDeploymentRepository=sonatype-nexus-staging::default::https://oss.sonatype.org/service/local/staging/deploy/maven2 ---- -The bootstrap properties will show up in the `/env` endpoint as a -high-priority property source, e.g. - ----- -$ curl localhost:8080/env -{ - "profiles":[], - "configService:https://github.com/spring-cloud-samples/config-repo/bar.properties":{"foo":"bar"}, - "servletContextInitParams":{}, - "systemProperties":{...}, - ... -} ----- - -(a property source called "configService:/" contains the property "foo" with value -"bar" and is highest priority). - -NOTE: the URL in the property source name is the git repository not -the config server URL. - -=== Sample Application - -There is a sample application -https://github.com/spring-cloud/spring-cloud-config/tree/master/spring-cloud-config-sample[here]. It -is a Spring Boot application so you can run it using the usual -mechanisms (for instance "mvn spring-boot:run"). When it runs it will -look for the config server on "http://localhost:8888" by default, so -you could run the server as well to see it all working together. - -The sample has a test case where the config server is also started in -the same JVM (with a different port), and the test asserts that an -environment property from the git configuration repo is present. To -change the location of the config server just set -"spring.cloud.config.uri" in "bootstrap.yml" (or via System -properties etc.). - -The test case has a `main()` method that runs the server in the same -way (watch the logs for its port), so you can run the whole system in -one process and play with it (e.g. right click on the main in your IDE -and run it). The `main()` method uses `target/config` for the working -directory of the git repository, so you can make local changes there -and see them reflected in the running app. - ----- -$ curl localhost:8080/env/foo -bar -$ vi target/config/bar.properties -.. change value of "foo", optionally commit -$ curl localhost:8080/refresh -["foo"] -$ curl localhost:8080/env/foo -baz ----- - -The refresh endpoint reports that the "foo" property changed. - -== Building - -=== JCE - -If you are getting an exception due to "Illegal key size" and you -are using Sun’s JDK, you need to install the Java Cryptography -Extension (JCE) Unlimited Strength Jurisdiction Policy Files. See -the following links for more information: - -http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html[Java 6 JCE] - -http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html[Java 7 JCE] - -http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html[Java 8 JCE] - -Extract files into JDK/jre/lib/security folder (whichever version of JRE/JDK x64/x86 you are using). - -:jdkversion: 1.7 - -=== Basic Compile and Test - -To build the source you will need to install JDK {jdkversion}. - -Spring Cloud uses Maven for most build-related activities, and you -should be able to get off the ground quite quickly by cloning the -project you are interested in and typing - ----- -$ ./mvnw install ----- - -NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command -in place of `./mvnw` in the examples below. If you do that you also -might need to add `-P spring` if your local Maven settings do not -contain repository declarations for spring pre-release artifacts. - -NOTE: Be aware that you might need to increase the amount of memory -available to Maven by setting a `MAVEN_OPTS` environment variable with -a value like `-Xmx512m -XX:MaxPermSize=128m`. We try to cover this in -the `.mvn` configuration, so if you find you have to do it to make a -build succeed, please raise a ticket to get the settings added to -source control. - -For hints on how to build the project look in `.travis.yml` if there -is one. There should be a "script" and maybe "install" command. Also -look at the "services" section to see if any services need to be -running locally (e.g. mongo or rabbit). Ignore the git-related bits -that you might find in "before_install" since they're related to setting git -credentials and you already have those. - -The projects that require middleware generally include a -`docker-compose.yml`, so consider using -http://compose.docker.io/[Docker Compose] to run the middeware servers -in Docker containers. See the README in the -https://github.com/spring-cloud-samples/scripts[scripts demo -repository] for specific instructions about the common cases of mongo, -rabbit and redis. - -NOTE: If all else fails, build with the command from `.travis.yml` (usually -`./mvnw install`). - -=== Documentation - -The spring-cloud-build module has a "docs" profile, and if you switch -that on it will try to build asciidoc sources from -`src/main/asciidoc`. As part of that process it will look for a -`README.adoc` and process it by loading all the includes, but not -parsing or rendering it, just copying it to `${main.basedir}` -(defaults to `${basedir}`, i.e. the root of the project). If there are -any changes in the README it will then show up after a Maven build as -a modified file in the correct place. Just commit it and push the change. - -=== Working with the code -If you don't have an IDE preference we would recommend that you use -http://www.springsource.com/developer/sts[Spring Tools Suite] or -http://eclipse.org[Eclipse] when working with the code. We use the -http://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools -should also work without issue as long as they use Maven 3.3.3 or better. - -==== Importing into eclipse with m2eclipse -We recommend the http://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with -eclipse. If you don't already have m2eclipse installed it is available from the "eclipse -marketplace". - -NOTE: Older versions of m2e do not support Maven 3.3, so once the -projects are imported into Eclipse you will also need to tell -m2eclipse to use the right profile for the projects. If you -see many different errors related to the POMs in the projects, check -that you have an up to date installation. If you can't upgrade m2e, -add the "spring" profile to your `settings.xml`. Alternatively you can -copy the repository settings from the "spring" profile of the parent -pom into your `settings.xml`. - -==== Importing into eclipse without m2eclipse -If you prefer not to use m2eclipse you can generate eclipse project metadata using the -following command: - -[indent=0] ----- - $ ./mvnw eclipse:eclipse ----- - -The generated eclipse projects can be imported by selecting `import existing projects` -from the `file` menu. - +(the "central" profile is available for all projects in Spring Cloud and it sets up the gpg jar signing, and the repository has to be specified separately for this project because it is a parent of the starter parent which users in turn have as their own parent). == Contributing @@ -380,4 +85,47 @@ added after the original pull request but before a merge. other target branch in the main project). * When writing a commit message please follow http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions], if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit - message (where XXXX is the issue number). \ No newline at end of file + message (where XXXX is the issue number). + +== Reusing the documentation + +Spring Cloud Build publishes its `spring-cloud-build-docs` module that contains +helpful scripts (e.g. README generation ruby script) and css, xslt and images +for the Spring Cloud documentation. If you want to follow the same convention +approach of generating documentation just add these plugins to your `docs` module + +[source,xml] +---- + + + docs + + + + org.apache.maven.plugins + maven-dependency-plugin <1> + + + org.asciidoctor + asciidoctor-maven-plugin <2> + + + com.agilejava.docbkx + docbkx-maven-plugin <3> + + + org.apache.maven.plugins + maven-antrun-plugin <4> + false + + + + + +---- +<1> This plugin downloads and unpacks the resources of the `spring-cloud-build-docs` module +<2> This plugin is required to parse the Asciidoctor documentation +<3> This plugin converts the Asciidoctor documentation into single and multi page docs +<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc + +IMPORTANT: The order of plugin declaration is important! \ No newline at end of file diff --git a/docs/src/main/asciidoc/quickstart.adoc b/docs/src/main/asciidoc/quickstart.adoc index 3340b8f7..2e0fd008 100644 --- a/docs/src/main/asciidoc/quickstart.adoc +++ b/docs/src/main/asciidoc/quickstart.adoc @@ -69,7 +69,7 @@ users. Example Maven configuration: org.springframework.boot spring-boot-starter-parent - 1.3.5.RELEASE + 1.5.10.RELEASE @@ -78,7 +78,7 @@ users. Example Maven configuration: org.springframework.cloud spring-cloud-dependencies - Brixton.RELEASE + Dalston.SR5 pom import From 37ad1427582976183e778005df7a05ce4f44424f Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Mon, 12 Feb 2018 11:33:02 -0500 Subject: [PATCH 09/31] Revert "Remove brixton reference" This reverts commit d0fb716 --- README.adoc | 372 +++++++++++++++++++++---- docs/src/main/asciidoc/quickstart.adoc | 4 +- 2 files changed, 314 insertions(+), 62 deletions(-) diff --git a/README.adoc b/README.adoc index ea497299..1c1402d1 100644 --- a/README.adoc +++ b/README.adoc @@ -1,44 +1,339 @@ // Do not edit this file (e.g. go instead to src/main/asciidoc) -image:https://circleci.com/gh/spring-cloud/spring-cloud-build.svg?style=svg[link="https://travis-ci.org/spring-cloud/spring-cloud-build"] +image::https://circleci.com/gh/spring-cloud/spring-cloud-config/tree/master.svg?style=svg["CircleCI", link="https://circleci.com/gh/spring-cloud/spring-cloud-config/tree/master"] +image::https://codecov.io/gh/spring-cloud/spring-cloud-config/branch/master/graph/badge.svg["Codecov", link="https://codecov.io/gh/spring-cloud/spring-cloud-config/branch/master"] +image::https://api.codacy.com/project/badge/Grade/f064024a072c477e97dca6ed5a70fccd?branch=master["Codacy code quality", link="https://www.codacy.com/app/Spring-Cloud/spring-cloud-config?branch=master&utm_source=github.com&utm_medium=referral&utm_content=spring-cloud/spring-cloud-config&utm_campaign=Badge_Grade"] -Spring Cloud Build is a common utility project for Spring Cloud -to use for plugin and dependency management. -== Building and Deploying +Spring Cloud Config provides server and client-side support for externalized configuration in a distributed system. With the Config Server you have a central place to manage external properties for applications across all environments. The concepts on both client and server map identically to the Spring `Environment` and `PropertySource` abstractions, so they fit very well with Spring applications, but can be used with any application running in any language. As an application moves through the deployment pipeline from dev to test and into production you can manage the configuration between those environments and be certain that applications have everything they need to run when they migrate. The default implementation of the server storage backend uses git so it easily supports labelled versions of configuration environments, as well as being accessible to a wide range of tooling for managing the content. It is easy to add alternative implementations and plug them in with Spring configuration. -To install locally: + +== Features + +=== Spring Cloud Config Server + +* HTTP, resource-based API for external configuration (name-value pairs, or equivalent YAML content) +* Encrypt and decrypt property values (symmetric or asymmetric) +* Embeddable easily in a Spring Boot application using `@EnableConfigServer` + +=== Spring Cloud Config Client + +Specifically for Spring applications: + +* Bind to the Config Server and initialize Spring `Environment` with remote property sources +* Encrypt and decrypt property values (symmetric or asymmetric) +* `@RefreshScope` for Spring `@Beans` that want to be re-initialized when configuration changes +* Management endpoints: +** `/env` for updating `Environment` and rebinding `@ConfigurationProperties` and log levels +** `/refresh` for refreshing the `@RefreshScope` beans +** `/restart` for restarting the Spring context (disabled by default) +** `/pause` and `/resume` for calling the `Lifecycle` methods (`stop()` and `start()` on the `ApplicationContext`) +* Bootstrap application context: a parent context for the main application that can be trained to do anything (by default it binds to the Config Server, and decrypts property values) + +== Quick Start + +Start the server: ---- - -$ mvn install -s .settings.xml +$ cd spring-cloud-config-server +$ ../mvnw spring-boot:run ---- -and to deploy snapshots to repo.spring.io: +The server is a Spring Boot application so you can run it from your +IDE instead if you prefer (the main class is +`ConfigServerApplication`). Then try out a client: ---- -$ mvn deploy -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local +$ curl localhost:8888/foo/development +{"name":"development","label":"master","propertySources":[ + {"name":"https://github.com/scratches/config-repo/foo-development.properties","source":{"bar":"spam"}}, + {"name":"https://github.com/scratches/config-repo/foo.properties","source":{"foo":"bar"}} +]} ---- -for a RELEASE build use +The default strategy for locating property sources is to clone a git +repository (at `spring.cloud.config.server.git.uri`) and use it to +initialize a mini `SpringApplication`. The mini-application's +`Environment` is used to enumerate property sources and publish them +via a JSON endpoint. + +The HTTP service has resources in the form: ---- -$ mvn deploy -DaltReleaseDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-release-local +/{application}/{profile}[/{label}] +/{application}-{profile}.yml +/{label}/{application}-{profile}.yml +/{application}-{profile}.properties +/{label}/{application}-{profile}.properties ---- -and for jcenter use +where the "application" is injected as the `spring.config.name` in the +`SpringApplication` (i.e. what is normally "application" in a regular +Spring Boot app), "profile" is an active profile (or comma-separated +list of properties), and "label" is an optional git label (defaults to +"master".) +Spring Cloud Config Server pulls configuration for remote clients +from a git repository (which must be provided): + +[source,yaml] ---- -$ mvn deploy -DaltReleaseDeploymentRepository=bintray::default::https://api.bintray.com/maven/spring/jars/org.springframework.cloud:build +spring: + cloud: + config: + server: + git: + uri: https://github.com/spring-cloud-samples/config-repo ---- -and for Maven Central use +=== Client Side Usage +To use these features in an application, just build it as a Spring +Boot application that depends on spring-cloud-config-client (e.g. see +the test cases for the config-client, or the sample app). The most +convenient way to add the dependency is via a Spring Boot starter +`org.springframework.cloud:spring-cloud-starter-config`. There is also a +parent pom and BOM (`spring-cloud-starter-parent`) for Maven users and a +Spring IO version management properties file for Gradle and Spring CLI +users. Example Maven configuration: + +[source,xml,indent=0] +.pom.xml ---- -$ mvn deploy -P central -DaltReleaseDeploymentRepository=sonatype-nexus-staging::default::https://oss.sonatype.org/service/local/staging/deploy/maven2 + + org.springframework.boot + spring-boot-starter-parent + 1.3.5.RELEASE + + + + + + + org.springframework.cloud + spring-cloud-dependencies + Brixton.RELEASE + pom + import + + + + + + + org.springframework.cloud + spring-cloud-starter-config + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + ---- -(the "central" profile is available for all projects in Spring Cloud and it sets up the gpg jar signing, and the repository has to be specified separately for this project because it is a parent of the starter parent which users in turn have as their own parent). +Then you can create a standard Spring Boot application, like this simple HTTP server: + +---- +@SpringBootApplication +@RestController +public class Application { + + @RequestMapping("/") + public String home() { + return "Hello World!"; + } + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} +---- + +When it runs it will pick up the external configuration from the +default local config server on port 8888 if it is running. To modify +the startup behaviour you can change the location of the config server +using `bootstrap.properties` (like `application.properties` but for +the bootstrap phase of an application context), e.g. + +---- +spring.cloud.config.uri: http://myconfigserver.com +---- + +The bootstrap properties will show up in the `/env` endpoint as a +high-priority property source, e.g. + +---- +$ curl localhost:8080/env +{ + "profiles":[], + "configService:https://github.com/spring-cloud-samples/config-repo/bar.properties":{"foo":"bar"}, + "servletContextInitParams":{}, + "systemProperties":{...}, + ... +} +---- + +(a property source called "configService:/" contains the property "foo" with value +"bar" and is highest priority). + +NOTE: the URL in the property source name is the git repository not +the config server URL. + +=== Sample Application + +There is a sample application +https://github.com/spring-cloud/spring-cloud-config/tree/master/spring-cloud-config-sample[here]. It +is a Spring Boot application so you can run it using the usual +mechanisms (for instance "mvn spring-boot:run"). When it runs it will +look for the config server on "http://localhost:8888" by default, so +you could run the server as well to see it all working together. + +The sample has a test case where the config server is also started in +the same JVM (with a different port), and the test asserts that an +environment property from the git configuration repo is present. To +change the location of the config server just set +"spring.cloud.config.uri" in "bootstrap.yml" (or via System +properties etc.). + +The test case has a `main()` method that runs the server in the same +way (watch the logs for its port), so you can run the whole system in +one process and play with it (e.g. right click on the main in your IDE +and run it). The `main()` method uses `target/config` for the working +directory of the git repository, so you can make local changes there +and see them reflected in the running app. + +---- +$ curl localhost:8080/env/foo +bar +$ vi target/config/bar.properties +.. change value of "foo", optionally commit +$ curl localhost:8080/refresh +["foo"] +$ curl localhost:8080/env/foo +baz +---- + +The refresh endpoint reports that the "foo" property changed. + +== Building + +=== JCE + +If you are getting an exception due to "Illegal key size" and you +are using Sun’s JDK, you need to install the Java Cryptography +Extension (JCE) Unlimited Strength Jurisdiction Policy Files. See +the following links for more information: + +http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html[Java 6 JCE] + +http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html[Java 7 JCE] + +http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html[Java 8 JCE] + +Extract files into JDK/jre/lib/security folder (whichever version of JRE/JDK x64/x86 you are using). + +:jdkversion: 1.7 + +=== Basic Compile and Test + +To build the source you will need to install JDK {jdkversion}. + +Spring Cloud uses Maven for most build-related activities, and you +should be able to get off the ground quite quickly by cloning the +project you are interested in and typing + +---- +$ ./mvnw install +---- + +NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command +in place of `./mvnw` in the examples below. If you do that you also +might need to add `-P spring` if your local Maven settings do not +contain repository declarations for spring pre-release artifacts. + +NOTE: Be aware that you might need to increase the amount of memory +available to Maven by setting a `MAVEN_OPTS` environment variable with +a value like `-Xmx512m -XX:MaxPermSize=128m`. We try to cover this in +the `.mvn` configuration, so if you find you have to do it to make a +build succeed, please raise a ticket to get the settings added to +source control. + +For hints on how to build the project look in `.travis.yml` if there +is one. There should be a "script" and maybe "install" command. Also +look at the "services" section to see if any services need to be +running locally (e.g. mongo or rabbit). Ignore the git-related bits +that you might find in "before_install" since they're related to setting git +credentials and you already have those. + +The projects that require middleware generally include a +`docker-compose.yml`, so consider using +http://compose.docker.io/[Docker Compose] to run the middeware servers +in Docker containers. See the README in the +https://github.com/spring-cloud-samples/scripts[scripts demo +repository] for specific instructions about the common cases of mongo, +rabbit and redis. + +NOTE: If all else fails, build with the command from `.travis.yml` (usually +`./mvnw install`). + +=== Documentation + +The spring-cloud-build module has a "docs" profile, and if you switch +that on it will try to build asciidoc sources from +`src/main/asciidoc`. As part of that process it will look for a +`README.adoc` and process it by loading all the includes, but not +parsing or rendering it, just copying it to `${main.basedir}` +(defaults to `${basedir}`, i.e. the root of the project). If there are +any changes in the README it will then show up after a Maven build as +a modified file in the correct place. Just commit it and push the change. + +=== Working with the code +If you don't have an IDE preference we would recommend that you use +http://www.springsource.com/developer/sts[Spring Tools Suite] or +http://eclipse.org[Eclipse] when working with the code. We use the +http://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools +should also work without issue as long as they use Maven 3.3.3 or better. + +==== Importing into eclipse with m2eclipse +We recommend the http://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with +eclipse. If you don't already have m2eclipse installed it is available from the "eclipse +marketplace". + +NOTE: Older versions of m2e do not support Maven 3.3, so once the +projects are imported into Eclipse you will also need to tell +m2eclipse to use the right profile for the projects. If you +see many different errors related to the POMs in the projects, check +that you have an up to date installation. If you can't upgrade m2e, +add the "spring" profile to your `settings.xml`. Alternatively you can +copy the repository settings from the "spring" profile of the parent +pom into your `settings.xml`. + +==== Importing into eclipse without m2eclipse +If you prefer not to use m2eclipse you can generate eclipse project metadata using the +following command: + +[indent=0] +---- + $ ./mvnw eclipse:eclipse +---- + +The generated eclipse projects can be imported by selecting `import existing projects` +from the `file` menu. + == Contributing @@ -85,47 +380,4 @@ added after the original pull request but before a merge. other target branch in the main project). * When writing a commit message please follow http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions], if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit - message (where XXXX is the issue number). - -== Reusing the documentation - -Spring Cloud Build publishes its `spring-cloud-build-docs` module that contains -helpful scripts (e.g. README generation ruby script) and css, xslt and images -for the Spring Cloud documentation. If you want to follow the same convention -approach of generating documentation just add these plugins to your `docs` module - -[source,xml] ----- - - - docs - - - - org.apache.maven.plugins - maven-dependency-plugin <1> - - - org.asciidoctor - asciidoctor-maven-plugin <2> - - - com.agilejava.docbkx - docbkx-maven-plugin <3> - - - org.apache.maven.plugins - maven-antrun-plugin <4> - false - - - - - ----- -<1> This plugin downloads and unpacks the resources of the `spring-cloud-build-docs` module -<2> This plugin is required to parse the Asciidoctor documentation -<3> This plugin converts the Asciidoctor documentation into single and multi page docs -<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc - -IMPORTANT: The order of plugin declaration is important! \ No newline at end of file + message (where XXXX is the issue number). \ No newline at end of file diff --git a/docs/src/main/asciidoc/quickstart.adoc b/docs/src/main/asciidoc/quickstart.adoc index 2e0fd008..3340b8f7 100644 --- a/docs/src/main/asciidoc/quickstart.adoc +++ b/docs/src/main/asciidoc/quickstart.adoc @@ -69,7 +69,7 @@ users. Example Maven configuration: org.springframework.boot spring-boot-starter-parent - 1.5.10.RELEASE + 1.3.5.RELEASE @@ -78,7 +78,7 @@ users. Example Maven configuration: org.springframework.cloud spring-cloud-dependencies - Dalston.SR5 + Brixton.RELEASE pom import From e1323939a66e94f9add801d45e6f03860f590b32 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Mon, 12 Feb 2018 11:35:35 -0500 Subject: [PATCH 10/31] Remove brixton reference --- README.adoc | 4 ++-- docs/src/main/asciidoc/quickstart.adoc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.adoc b/README.adoc index 1c1402d1..6ed11759 100644 --- a/README.adoc +++ b/README.adoc @@ -103,7 +103,7 @@ users. Example Maven configuration: org.springframework.boot spring-boot-starter-parent - 1.3.5.RELEASE + 1.5.10.RELEASE @@ -112,7 +112,7 @@ users. Example Maven configuration: org.springframework.cloud spring-cloud-dependencies - Brixton.RELEASE + Dalston.SR5 pom import diff --git a/docs/src/main/asciidoc/quickstart.adoc b/docs/src/main/asciidoc/quickstart.adoc index 3340b8f7..2e0fd008 100644 --- a/docs/src/main/asciidoc/quickstart.adoc +++ b/docs/src/main/asciidoc/quickstart.adoc @@ -69,7 +69,7 @@ users. Example Maven configuration: org.springframework.boot spring-boot-starter-parent - 1.3.5.RELEASE + 1.5.10.RELEASE @@ -78,7 +78,7 @@ users. Example Maven configuration: org.springframework.cloud spring-cloud-dependencies - Brixton.RELEASE + Dalston.SR5 pom import From aa0afd28b689c537349edbbd58bffa400ec4235b Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Mon, 12 Feb 2018 11:36:14 -0500 Subject: [PATCH 11/31] Remove brixton reference --- README.adoc | 4 ++-- docs/src/main/asciidoc/quickstart.adoc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.adoc b/README.adoc index 34f31512..bc36458e 100644 --- a/README.adoc +++ b/README.adoc @@ -103,7 +103,7 @@ users. Example Maven configuration: org.springframework.boot spring-boot-starter-parent - 1.3.5.RELEASE + 1.5.10.RELEASE @@ -112,7 +112,7 @@ users. Example Maven configuration: org.springframework.cloud spring-cloud-dependencies - Brixton.RELEASE + Edgware.SR2 pom import diff --git a/docs/src/main/asciidoc/quickstart.adoc b/docs/src/main/asciidoc/quickstart.adoc index f8adef5b..f3050019 100644 --- a/docs/src/main/asciidoc/quickstart.adoc +++ b/docs/src/main/asciidoc/quickstart.adoc @@ -69,7 +69,7 @@ users. Example Maven configuration: org.springframework.boot spring-boot-starter-parent - 1.3.5.RELEASE + 1.5.10.RELEASE @@ -78,7 +78,7 @@ users. Example Maven configuration: org.springframework.cloud spring-cloud-dependencies - Brixton.RELEASE + Edgware.SR2 pom import From 390e2b5e4f4b5f168288f528d4386321e2c71d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Schmied?= Date: Thu, 1 Mar 2018 23:01:33 +0100 Subject: [PATCH 12/31] add placeholder support for {application} in EnvironmentController (#867) * add placeholder support for {application} in EnvironmentController * add tests --- .../environment/EnvironmentControllerTests.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/EnvironmentControllerTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/EnvironmentControllerTests.java index 1eb3a85f..7e1d92e5 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/EnvironmentControllerTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/EnvironmentControllerTests.java @@ -203,6 +203,20 @@ public class EnvironmentControllerTests { assertThat(environment.getPropertySources().get(1).getSource().entrySet(), hasSize(3)); } + + @Test + public void testNameWithSlash() { + this.controller.labelled("foo(_)spam", "bar", "two"); + + Mockito.verify(this.repository).findOne("foo/spam", "bar", "two"); + } + + @Test + public void testLabelWithSlash() { + this.controller.labelled("foo", "bar", "two(_)spam"); + + Mockito.verify(this.repository).findOne("foo", "bar", "two/spam"); + } @Test public void arrayOverridenInYaml() throws Exception { From fb2a01fd7fa9992e09ddce6226e1f6c04cd81008 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sat, 17 Mar 2018 10:33:05 -0400 Subject: [PATCH 13/31] circle 2.0 config --- .circleci/config.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..4d168f7f --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,39 @@ +version: 2 +jobs: + build: + docker: + - image: springcloud/pipeline-base + environment: + _JAVA_OPTIONS: "-Xms1024m -Xmx2048m" + TERM: dumb + branches: + ignore: + - gh-pages # list of branches to ignore + resource_class: large + steps: + - checkout + - restore_cache: + key: sc-config-{{ .Branch }} + - run: + name: "Download dependencies" + command: ./mvnw -s .settings.xml -U --fail-never dependency:go-offline || true + - save_cache: + key: sc-oconfig-{{ .Branch }} + paths: + - ~/.m2 + - run: + name: "Running build" + command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + - run: + name: "Aggregate test results" + when: always + command: | + mkdir -p $CIRCLE_TEST_REPORTS/junit/ + find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \; + bash <(curl -s https://codecov.io/bash) + - store_artifacts: + path: /junit/ + destination: artifacts + - store_test_results: + path: /junit/ + destination: testartifacts \ No newline at end of file From 10f19393965c6fa83ec2ac73e5e7101f9d94c50d Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sat, 17 Mar 2018 10:52:02 -0400 Subject: [PATCH 14/31] using openjdk --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d168f7f..732a2e60 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: springcloud/pipeline-base + - image: circleci/openjdk environment: _JAVA_OPTIONS: "-Xms1024m -Xmx2048m" TERM: dumb From c1b4c2513305de3ae63b4000dc12c085a0c213bf Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sat, 17 Mar 2018 14:31:37 -0400 Subject: [PATCH 15/31] using new pipelinebase image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 732a2e60..1a24a901 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: circleci/openjdk + - image: ryanjbaxter/pipeline-base environment: _JAVA_OPTIONS: "-Xms1024m -Xmx2048m" TERM: dumb From 69a7ebd3d5ed507aefa351c20787795460ff374d Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sat, 17 Mar 2018 15:36:40 -0400 Subject: [PATCH 16/31] running circleci build as non root --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a24a901..74587a10 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,7 +23,9 @@ jobs: - ~/.m2 - run: name: "Running build" - command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + command: | + su appuser + ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - run: name: "Aggregate test results" when: always From 41c933817f80d040ee0d20817f70b651ce9440a8 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sat, 17 Mar 2018 15:46:35 -0400 Subject: [PATCH 17/31] adding switch user command --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 74587a10..8e0a4889 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,11 +21,12 @@ jobs: key: sc-oconfig-{{ .Branch }} paths: - ~/.m2 + - run: + name: "Switching User" + command: su appuser - run: name: "Running build" - command: | - su appuser - ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - run: name: "Aggregate test results" when: always From f6198bf2c196b31bfdd8e142a114183ed60f19f8 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sat, 17 Mar 2018 16:26:32 -0400 Subject: [PATCH 18/31] removing switch user command --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e0a4889..1a24a901 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,9 +21,6 @@ jobs: key: sc-oconfig-{{ .Branch }} paths: - ~/.m2 - - run: - name: "Switching User" - command: su appuser - run: name: "Running build" command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn From 90d67888bddac287191077e8a64bc6a61904357b Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 07:22:47 -0400 Subject: [PATCH 19/31] creating user in circleci --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a24a901..5b0b44b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,11 @@ jobs: key: sc-oconfig-{{ .Branch }} paths: - ~/.m2 + - run: + name: "Creating user" + command: | + groupadd -g 888 configuser && \ + useradd -r -u 888 -m -g configuser configuser - run: name: "Running build" command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn From 38611c8b5d07f62811cf2d274ccb96778852ad67 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 07:24:03 -0400 Subject: [PATCH 20/31] fixing yaml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b0b44b9..8d064fa7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,8 +24,8 @@ jobs: - run: name: "Creating user" command: | - groupadd -g 888 configuser && \ - useradd -r -u 888 -m -g configuser configuser + groupadd -g 888 configuser && \ + useradd -r -u 888 -m -g configuser configuser - run: name: "Running build" command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn From ae4b597a81724aa6bef30c8c24d7709fa727732a Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 07:27:20 -0400 Subject: [PATCH 21/31] switching to root --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8d064fa7..624d0cf7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,7 @@ jobs: - run: name: "Creating user" command: | + su root && \ groupadd -g 888 configuser && \ useradd -r -u 888 -m -g configuser configuser - run: From 8ec94181d0762e96d9fc8ce60c43d8da68809895 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 07:31:22 -0400 Subject: [PATCH 22/31] removing switching to root --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 624d0cf7..8d064fa7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,6 @@ jobs: - run: name: "Creating user" command: | - su root && \ groupadd -g 888 configuser && \ useradd -r -u 888 -m -g configuser configuser - run: From 10edd7adf8caf7779d1deedf17b2c947565010c8 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 11:03:45 -0400 Subject: [PATCH 23/31] switch user to new configuser --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8d064fa7..eb6f1598 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,7 +25,9 @@ jobs: name: "Creating user" command: | groupadd -g 888 configuser && \ - useradd -r -u 888 -m -g configuser configuser + useradd -r -u 888 -m -g configuser configuser && \ + passwd -d configuser && \ + su configuser - run: name: "Running build" command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn From f5630da4cb502bbde485ba25060515f0ad6a68a3 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 11:10:23 -0400 Subject: [PATCH 24/31] running build as configuser --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eb6f1598..5f5abe3b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,11 +26,10 @@ jobs: command: | groupadd -g 888 configuser && \ useradd -r -u 888 -m -g configuser configuser && \ - passwd -d configuser && \ - su configuser + passwd -d configuser - run: name: "Running build" - command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn + command: su configuser -c './mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' - run: name: "Aggregate test results" when: always From 30d30ffb8f6f478e708b6d1572ee73bc6b85d4c0 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 11:17:57 -0400 Subject: [PATCH 25/31] specifying user in docker command --- .circleci/config.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f5abe3b..ac6bfc4f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,7 @@ jobs: build: docker: - image: ryanjbaxter/pipeline-base + - user: appuser environment: _JAVA_OPTIONS: "-Xms1024m -Xmx2048m" TERM: dumb @@ -21,15 +22,9 @@ jobs: key: sc-oconfig-{{ .Branch }} paths: - ~/.m2 - - run: - name: "Creating user" - command: | - groupadd -g 888 configuser && \ - useradd -r -u 888 -m -g configuser configuser && \ - passwd -d configuser - run: name: "Running build" - command: su configuser -c './mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn - run: name: "Aggregate test results" when: always From 01c6ff7951e7ff8d1ca5c75558dff422cabc3f43 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 11:20:36 -0400 Subject: [PATCH 26/31] Fixing yaml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ac6bfc4f..43e5ec23 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: docker: - image: ryanjbaxter/pipeline-base - - user: appuser + user: appuser environment: _JAVA_OPTIONS: "-Xms1024m -Xmx2048m" TERM: dumb From ccf295ec493dd5a83a6e07dc5744f9c50c45e64a Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 11:28:58 -0400 Subject: [PATCH 27/31] Use users home directory to store junit reports --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 43e5ec23..f7f45419 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,12 +29,12 @@ jobs: name: "Aggregate test results" when: always command: | - mkdir -p $CIRCLE_TEST_REPORTS/junit/ - find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \; + mkdir -p $HOME/$CIRCLE_TEST_REPORTS/junit/ + find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} $HOME/$CIRCLE_TEST_REPORTS/junit/ \; bash <(curl -s https://codecov.io/bash) - store_artifacts: - path: /junit/ + path: $HOME/$CIRCLE_TEST_REPORTS/junit/ destination: artifacts - store_test_results: - path: /junit/ + path: $HOME/$CIRCLE_TEST_REPORTS/junit/ destination: testartifacts \ No newline at end of file From ae24dbfc917c68bfa32bcad2cfd38149edf8b0e6 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 13:26:10 -0400 Subject: [PATCH 28/31] Testing env vars in circle config --- .circleci/config.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f7f45419..347ee59c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,12 +29,14 @@ jobs: name: "Aggregate test results" when: always command: | - mkdir -p $HOME/$CIRCLE_TEST_REPORTS/junit/ - find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} $HOME/$CIRCLE_TEST_REPORTS/junit/ \; + echo HOME $HOME && \ + echo testdir $CIRCLE_TEST_REPORTS && \ + mkdir -p $CIRCLE_TEST_REPORTS/junit/ + find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} ~/junit/ \; bash <(curl -s https://codecov.io/bash) - store_artifacts: - path: $HOME/$CIRCLE_TEST_REPORTS/junit/ + path: ~/junit/ destination: artifacts - store_test_results: - path: $HOME/$CIRCLE_TEST_REPORTS/junit/ + path: ~/junit/ destination: testartifacts \ No newline at end of file From 5646e7ac286ed1625017759248ab2fba29648b53 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Sun, 18 Mar 2018 14:46:33 -0400 Subject: [PATCH 29/31] Fixing test dir --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 347ee59c..33d39e8c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,9 +29,7 @@ jobs: name: "Aggregate test results" when: always command: | - echo HOME $HOME && \ - echo testdir $CIRCLE_TEST_REPORTS && \ - mkdir -p $CIRCLE_TEST_REPORTS/junit/ + mkdir -p ~/junit/ find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} ~/junit/ \; bash <(curl -s https://codecov.io/bash) - store_artifacts: From 262957776e0903f82e1b7e43ed19e3484a3745e3 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Mon, 19 Mar 2018 09:47:03 -0400 Subject: [PATCH 30/31] using official spring-cloud/pipeline-base image from dockerhub --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 33d39e8c..c5252686 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: ryanjbaxter/pipeline-base + - image: spring-cloud/pipeline-base user: appuser environment: _JAVA_OPTIONS: "-Xms1024m -Xmx2048m" From 089032fd94df0a68d60035633174474f499a1a93 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Mon, 19 Mar 2018 09:48:20 -0400 Subject: [PATCH 31/31] Fixing springcloud org name in image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c5252686..59aa1df9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: spring-cloud/pipeline-base + - image: springcloud/pipeline-base user: appuser environment: _JAVA_OPTIONS: "-Xms1024m -Xmx2048m"