From 3b0d488d73f1514ec76685347e12021a260f9aa6 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Tue, 23 Jun 2015 10:15:58 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- spring-cloud-cli.html | 93 +++++-------------------------------------- 1 file changed, 9 insertions(+), 84 deletions(-) diff --git a/spring-cloud-cli.html b/spring-cloud-cli.html index 4337c4b..50e1b2a 100644 --- a/spring-cloud-cli.html +++ b/spring-cloud-cli.html @@ -417,13 +417,8 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
-

Spring Boot CLI provides Spring Boot command line features for -Spring Cloud. You can write Groovy scripts to run Spring Cloud component applications -(e.g. @EnableEurekaServer). You can also easily do things like encryption and decryption to support Spring Cloud -Config clients with secret configuration values.

-
-
@@ -439,7 +434,7 @@ sure you have
$ spring version
-Spring CLI v1.2.3.RELEASE
+Spring CLI v1.2.1.RELEASE
@@ -447,8 +442,8 @@ Spring CLI v1.2.3.RELEASE
-
$ gvm install springboot 1.2.3.RELEASE
-$ gvm use springboot 1.2.3.RELEASE
+
$ gvm install springboot 1.2.1.RELEASE
+$ gvm use springboot 1.2.1.RELEASE
@@ -457,9 +452,11 @@ $ gvm use springboot 1.2.3.RELEASE
$ mvn install
-$ spring install org.springframework.cloud:spring-cloud-cli:1.0.2.RELEASE
+$ spring install org.springframework.cloud:spring-cloud-cli:1.0.0.BUILD-SNAPSHOT
+
+

Encryption and Decryption

@@ -478,83 +475,11 @@ in the JRE lib/security directory with the ones that you downloaded). -
-

Writing Groovy Scripts and Running Applications

-
-
-

Spring Cloud CLI has support for most of the Spring Cloud declarative -features, such as the @Enable* class of annotations. For example, -here is a fully functional Eureka server

-
-
-
app.groovy
-
-
@EnableEurekaServer
-class Eureka {}
-
-
-
-

which you can run from the command line like this

-
-
-
-
$ spring run app.groovy
-
-
-
-

To include additional dependencies, often it suffices just to add the -appropriate feature-enabling annotation, e.g. @EnableConfigServer, -@EnableOAuth2Sso or @EnableEurekaClient. To manually include a -dependency you can use a @Grab with the special "Spring Boot" short -style artifact co-ordinates, i.e. with just the artifact ID (no need -for group or version information), e.g. to set up a client app to -listen on AMQP for management events from the Spring CLoud Bus:

-
-
-
app.groovy
-
-
@Grab('spring-cloud-starter-bus-amqp')
-@RestController
-class Service {
-  @RequestMapping('/')
-  def home() { [message: 'Hello'] }
-}
-
-
-
-
-
-

Encryption and Decryption

-
-
-

The Spring Cloud CLI comes with an "encrypt" and a "decrypt" -command. Both accept arguments in the same form with a key specified -as a mandatory "--key", e.g.

-
-
-
-
$ spring encrypt mysecret --key foo
-682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bda
-$ spring decrypt --key foo 682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bda
-mysecret
-
-
-
-

To use a key in a file (e.g. an RSA public key for encyption) prepend -the key value with "@" and provide the file path, e.g.

-
-
-
-
$ spring encrypt mysecret --key @${HOME}/.ssh/id_rsa.pub
-AQAjPgt3eFZQXwt8tsHAVv/QHiY5sI2dRcR+...
-
-
-