Add link to github in rendered docs
This commit is contained in:
@@ -1,7 +1,71 @@
|
||||
= Spring Boot Cloud CLI
|
||||
:github: https://github.com/spring-cloud/spring-cloud-cli
|
||||
:githubmaster: {github}/tree/master
|
||||
:docslink: {githubmaster}/docs/src/main/asciidoc
|
||||
|
||||
include::intro.adoc[]
|
||||
|
||||
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing-docs.adoc[]
|
||||
|
||||
== Installation
|
||||
|
||||
include::install.adoc[]
|
||||
|
||||
== 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
|
||||
[source,groovy,indent=0]
|
||||
----
|
||||
@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
|
||||
[source,groovy,indent=0]
|
||||
----
|
||||
@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+...
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user