Added the redirection link to the documentation
This commit is contained in:
122
index.html
122
index.html
@@ -1,120 +1,12 @@
|
||||
---
|
||||
# The name of your project
|
||||
title: Spring Cloud CLI
|
||||
|
||||
badges:
|
||||
|
||||
# Specify your project's twitter handle, if any. Delete if none.
|
||||
# twitter: SpringData
|
||||
|
||||
# Customize your project's badges. Delete any entries that do not apply.
|
||||
custom:
|
||||
- name: Source (GitHub)
|
||||
url: https://github.com/spring-cloud/spring-cloud-cli
|
||||
icon: github
|
||||
|
||||
- name: StackOverflow
|
||||
url: https://stackoverflow.com/questions/tagged/spring-cloud
|
||||
icon: stackoverflow
|
||||
|
||||
---
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
|
||||
<!-- Specify the parent of this project (or delete if none) to influence the rendering of the breadcrumb -->
|
||||
{% capture parent_link %}
|
||||
[Spring Parent]({{ site.projects_site_url }}/spring-cloud)
|
||||
{% endcapture %}
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="refresh" content="1; url=https://cloud.spring.io/spring-cloud-cli/reference/html/">
|
||||
|
||||
<script>
|
||||
window.location.href = "https://cloud.spring.io/spring-cloud-cli/reference/html/"
|
||||
</script>
|
||||
|
||||
{% capture billboard_description %}
|
||||
<title>Page Redirection</title>
|
||||
|
||||
Spring Cloud CLI is a set of extensions for the [Spring Boot
|
||||
CLI](https://docs.spring.io/spring-boot) making it possible to run
|
||||
Spring Cloud server apps and write Spring Cloud apps in Groovy scripts
|
||||
and run them from a shell. Auto-imports and dependency management is
|
||||
provided for all Spring Cloud projects.
|
||||
|
||||
{% endcapture %}
|
||||
|
||||
{% capture main_content %}
|
||||
|
||||
<span id="quick-start"></span>
|
||||
|
||||
## Quick Start
|
||||
|
||||
To install the CLI, make
|
||||
sure you have
|
||||
[Spring Boot CLI](https://github.com/spring-projects/spring-boot)
|
||||
(1.4.4 or better):
|
||||
|
||||
$ spring version
|
||||
Spring CLI v1.5.3.RELEASE
|
||||
|
||||
E.g. for SDKMan users
|
||||
|
||||
```
|
||||
$ sdk install springboot 1.5.3.RELEASE
|
||||
$ sdk use springboot 1.5.3.RELEASE
|
||||
```
|
||||
|
||||
and install the Spring Cloud plugin:
|
||||
|
||||
```
|
||||
$ spring install org.springframework.cloud:spring-cloud-cli:1.3.1.RELEASE
|
||||
```
|
||||
|
||||
### Launch a Server
|
||||
|
||||
To run a config server:
|
||||
|
||||
```
|
||||
$ spring cloud configserver
|
||||
```
|
||||
|
||||
You can also run eureka, zipkin, hystrixdashboard, h2, kafka or
|
||||
dataflow (multiple apps can be run if separated by spaces on the
|
||||
command line).
|
||||
|
||||
### Write a Groovy Script and Run It
|
||||
|
||||
Any Spring Boot CLI app with the Cloud CLI extensions installed will
|
||||
be a Spring Cloud Config Client, so set the `spring.cloud.config.uri`
|
||||
to point to a Config Server and you are in business (defaults to
|
||||
"http://localhost:8888").
|
||||
|
||||
Here's a complete Eureka Server:
|
||||
|
||||
```groovy
|
||||
@EnableEurekaServer
|
||||
@RestController
|
||||
class Eureka {}
|
||||
```
|
||||
|
||||
### Encrypt and Decrypt
|
||||
|
||||
Example (symmetric key):
|
||||
|
||||
```
|
||||
$ spring encrypt --key=secret foo
|
||||
```
|
||||
|
||||
IMPORTANT: **Prerequisites:** to use the encryption and decryption features
|
||||
you need the full-strength JCE installed in your JVM (it's not there by default).
|
||||
You can download the "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files"
|
||||
from Oracle, and follow instructions for installation (essentially replace the 2 policy files
|
||||
in the JRE lib/security directory with the ones that you downloaded).
|
||||
|
||||
{% endcapture %}
|
||||
|
||||
{% capture related_resources %}
|
||||
|
||||
### Sample Projects
|
||||
|
||||
* [Minimal (Groovy) Client](https://github.com/spring-cloud-samples/scripts/blob/master/demo/client.groovy)
|
||||
|
||||
{% endcapture %}
|
||||
|
||||
|
||||
{% include project_page.html %}
|
||||
</html>
|
||||
If you are not redirected automatically, follow the <a href='https://cloud.spring.io/spring-cloud-cli/reference/html/'>link to latest snapshot documentation</a>
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Spring Boot Cloud CLI</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-cli.html" title="Spring Boot Cloud CLI"><link rel="next" href="multi_pr01.html" title=""></head><body class="firstpage" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Spring Boot Cloud CLI</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi_pr01.html">Next</a></td></tr></table><hr></div><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Boot Cloud CLI</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="multi_pr01.html"></a></span></dt><dt><span class="chapter"><a href="multi__installation.html">1. Installation</a></span></dt><dt><span class="chapter"><a href="multi__running_spring_cloud_services_in_development.html">2. Running Spring Cloud Services in Development</a></span></dt><dd><dl><dt><span class="section"><a href="multi__running_spring_cloud_services_in_development.html#_adding_additional_applications">2.1. Adding Additional Applications</a></span></dt></dl></dd><dt><span class="chapter"><a href="multi__writing_groovy_scripts_and_running_applications.html">3. Writing Groovy Scripts and Running Applications</a></span></dt><dt><span class="chapter"><a href="multi__encryption_and_decryption.html">4. Encryption and Decryption</a></span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi_pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="refresh" content="1; url=https://cloud.spring.io/spring-cloud-cli/reference/html/">
|
||||
|
||||
<script>
|
||||
window.location.href = "https://cloud.spring.io/spring-cloud-cli/reference/html/"
|
||||
</script>
|
||||
|
||||
<title>Page Redirection</title>
|
||||
|
||||
If you are not redirected automatically, follow the <a href='https://cloud.spring.io/spring-cloud-cli/reference/html/'>link to latest snapshot documentation</a>
|
||||
|
||||
12
single/index.html
Normal file
12
single/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="refresh" content="1; url=https://cloud.spring.io/spring-cloud-cli/reference/html/">
|
||||
|
||||
<script>
|
||||
window.location.href = "https://cloud.spring.io/spring-cloud-cli/reference/html/"
|
||||
</script>
|
||||
|
||||
<title>Page Redirection</title>
|
||||
|
||||
If you are not redirected automatically, follow the <a href='https://cloud.spring.io/spring-cloud-cli/reference/html/'>link to latest snapshot documentation</a>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,419 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="generator" content="Asciidoctor 1.5.7.1">
|
||||
<title>Spring Boot Cloud CLI</title>
|
||||
<link rel="stylesheet" href="css/spring.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<meta http-equiv="refresh" content="1; url=https://cloud.spring.io/spring-cloud-cli/reference/html/">
|
||||
|
||||
<style>
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.switch {
|
||||
border-width: 1px 1px 0 1px;
|
||||
border-style: solid;
|
||||
border-color: #7a2518;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.switch--item {
|
||||
padding: 10px;
|
||||
background-color: #ffffff;
|
||||
color: #7a2518;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.switch--item:not(:first-child) {
|
||||
border-width: 0 0 0 1px;
|
||||
border-style: solid;
|
||||
border-color: #7a2518;
|
||||
}
|
||||
|
||||
.switch--item.selected {
|
||||
background-color: #7a2519;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function addBlockSwitches() {
|
||||
$('.primary').each(function() {
|
||||
primary = $(this);
|
||||
createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected");
|
||||
primary.children('.title').remove();
|
||||
});
|
||||
$('.secondary').each(function(idx, node) {
|
||||
secondary = $(node);
|
||||
primary = findPrimary(secondary);
|
||||
switchItem = createSwitchItem(secondary, primary.children('.switch'));
|
||||
switchItem.content.addClass('hidden');
|
||||
findPrimary(secondary).append(switchItem.content);
|
||||
secondary.remove();
|
||||
});
|
||||
}
|
||||
|
||||
function createBlockSwitch(primary) {
|
||||
blockSwitch = $('<div class="switch"></div>');
|
||||
primary.prepend(blockSwitch);
|
||||
return blockSwitch;
|
||||
}
|
||||
|
||||
function findPrimary(secondary) {
|
||||
candidate = secondary.prev();
|
||||
while (!candidate.is('.primary')) {
|
||||
candidate = candidate.prev();
|
||||
}
|
||||
return candidate;
|
||||
}
|
||||
|
||||
function createSwitchItem(block, blockSwitch) {
|
||||
blockName = block.children('.title').text();
|
||||
content = block.children('.content').first().append(block.next('.colist'));
|
||||
item = $('<div class="switch--item">' + blockName + '</div>');
|
||||
item.on('click', '', content, function(e) {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
e.data.siblings('.content').addClass('hidden');
|
||||
e.data.removeClass('hidden');
|
||||
});
|
||||
blockSwitch.append(item);
|
||||
return {'item': item, 'content': content};
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
<script>
|
||||
window.location.href = "https://cloud.spring.io/spring-cloud-cli/reference/html/"
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="book toc2 toc-left">
|
||||
<div id="header">
|
||||
<h1>Spring Boot Cloud CLI</h1>
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#_installation">Installation</a></li>
|
||||
<li><a href="#_running_spring_cloud_services_in_development">Running Spring Cloud Services in Development</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_adding_additional_applications">Adding Additional Applications</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_writing_groovy_scripts_and_running_applications">Writing Groovy Scripts and Running Applications</a></li>
|
||||
<li><a href="#_encryption_and_decryption">Encryption and Decryption</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="preamble">
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Boot CLI provides <a href="https://projects.spring.io/spring-boot">Spring
|
||||
Boot</a> command line features for <a href="https://github.com/spring-cloud">Spring
|
||||
Cloud</a>. You can write Groovy scripts to run Spring Cloud component
|
||||
applications (e.g. <code>@EnableEurekaServer</code>). You can also easily do
|
||||
things like encryption and decryption to support Spring Cloud Config
|
||||
clients with secret configuration values. With the Launcher CLI you
|
||||
can launch services like Eureka, Zipkin, Config Server
|
||||
conveniently all at once from the command line (very useful at
|
||||
development time).</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
Spring Cloud is released under the non-restrictive Apache 2.0 license. If you would like to contribute to this section of the documentation or if you find an error, please find the source code and issue trackers in the project at <a href="https://github.com/spring-cloud/spring-cloud-cli/tree/master/docs/src/main/asciidoc">github</a>.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_installation"><a class="link" href="#_installation">Installation</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>To install, make
|
||||
sure you have
|
||||
<a href="https://github.com/spring-projects/spring-boot">Spring Boot CLI</a>
|
||||
(2.0.0 or better):</p>
|
||||
</div>
|
||||
<div class="literalblock">
|
||||
<div class="content">
|
||||
<pre>$ spring version
|
||||
Spring CLI v2.2.0.BUILD-SNAPSHOT</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>E.g. for SDKMan users</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code>$ sdk install springboot 2.2.0.BUILD-SNAPSHOT
|
||||
$ sdk use springboot 2.2.0.BUILD-SNAPSHOT</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>and install the Spring Cloud plugin</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code>$ mvn install
|
||||
$ spring install org.springframework.cloud:spring-cloud-cli:2.2.0.BUILD-SNAPSHOT</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admonitionblock important">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-important" title="Important"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
<strong>Prerequisites:</strong> to use the encryption and decryption features
|
||||
you need the full-strength JCE installed in your JVM (it’s not there by default).
|
||||
You can download the "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files"
|
||||
from Oracle, and follow instructions for installation (essentially replace the 2 policy files
|
||||
in the JRE lib/security directory with the ones that you downloaded).
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_running_spring_cloud_services_in_development"><a class="link" href="#_running_spring_cloud_services_in_development">Running Spring Cloud Services in Development</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>The Launcher CLI can be used to run common services like Eureka,
|
||||
Config Server etc. from the command line. To list the available
|
||||
services you can do <code>spring cloud --list</code>, and to launch a default set
|
||||
of services just <code>spring cloud</code>. To choose the services to deploy,
|
||||
just list them on the command line, e.g.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>$ spring cloud eureka configserver h2 kafka stubrunner zipkin</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Summary of supported deployables:</p>
|
||||
</div>
|
||||
<table class="tableblock frame-all grid-all stretch">
|
||||
<colgroup>
|
||||
<col style="width: 25%;">
|
||||
<col style="width: 25%;">
|
||||
<col style="width: 25%;">
|
||||
<col style="width: 25%;">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="tableblock halign-left valign-top">Service</th>
|
||||
<th class="tableblock halign-left valign-top">Name</th>
|
||||
<th class="tableblock halign-left valign-top">Address</th>
|
||||
<th class="tableblock halign-left valign-top">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">eureka</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Eureka Server</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="http://localhost:8761" class="bare">http://localhost:8761</a></p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Eureka server for service registration and discovery. All the other services show up in its catalog by default.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">configserver</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Config Server</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="http://localhost:8888" class="bare">http://localhost:8888</a></p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Spring Cloud Config Server running in the "native" profile and serving configuration from the local directory ./launcher</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">h2</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">H2 Database</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="http://localhost:9095" class="bare">http://localhost:9095</a> (console), jdbc:h2:tcp://localhost:9096/{data}</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Relation database service. Use a file path for <code>{data}</code> (e.g. <code>./target/test</code>) when you connect. Remember that you can add <code>;MODE=MYSQL</code> or <code>;MODE=POSTGRESQL</code> to connect with compatibility to other server types.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">kafka</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kafka Broker</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="http://localhost:9091" class="bare">http://localhost:9091</a> (actuator endpoints), localhost:9092</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">hystrixdashboard</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Hystrix Dashboard</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="http://localhost:7979" class="bare">http://localhost:7979</a></p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Any Spring Cloud app that declares Hystrix circuit breakers publishes metrics on <code>/hystrix.stream</code>. Type that address into the dashboard to visualize all the metrics,</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">dataflow</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Dataflow Server</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="http://localhost:9393" class="bare">http://localhost:9393</a></p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Spring Cloud Dataflow server with UI at /admin-ui. Connect the Dataflow shell to target at root path.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">zipkin</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Zipkin Server</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="http://localhost:9411" class="bare">http://localhost:9411</a></p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Zipkin Server with UI for visualizing traces. Stores span data in memory and accepts them via HTTP POST of JSON data.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">stubrunner</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Stub Runner Boot</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="http://localhost:8750" class="bare">http://localhost:8750</a></p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Downloads WireMock stubs, starts WireMock and feeds the started servers with stored stubs. Pass <code>stubrunner.ids</code> to pass stub coordinates and then go to <code><a href="http://localhost:8750/stubs" class="bare">http://localhost:8750/stubs</a></code>.</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="paragraph">
|
||||
<p>Each of these apps can be configured using a local YAML file with the same name (in the current
|
||||
working directory or a subdirectory called "config" or in <code>~/.spring-cloud</code>). E.g. in <code>configserver.yml</code> you might want to
|
||||
do something like this to locate a local git repository for the backend:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">configserver.yml</div>
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spring:
|
||||
profiles:
|
||||
active: git
|
||||
cloud:
|
||||
config:
|
||||
server:
|
||||
git:
|
||||
uri: file://${user.home}/dev/demo/config-repo</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>E.g. in Stub Runner app you could fetch stubs from your local <code>.m2</code> in the following way.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">stubrunner.yml</div>
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">stubrunner:
|
||||
workOffline: true
|
||||
ids:
|
||||
- com.example:beer-api-producer:+:9876</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_adding_additional_applications"><a class="link" href="#_adding_additional_applications">Adding Additional Applications</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Additional applications can be added to <code>./config/cloud.yml</code> (not
|
||||
<code>./config.yml</code> because that would replace the defaults), e.g. with</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">config/cloud.yml</div>
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">spring:
|
||||
cloud:
|
||||
launcher:
|
||||
deployables:
|
||||
source:
|
||||
coordinates: maven://com.example:source:0.0.1-SNAPSHOT
|
||||
port: 7000
|
||||
sink:
|
||||
coordinates: maven://com.example:sink:0.0.1-SNAPSHOT
|
||||
port: 7001</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>when you list the apps:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code>$ spring cloud --list
|
||||
source sink configserver dataflow eureka h2 hystrixdashboard kafka stubrunner zipkin</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>(notice the additional apps at the start of the list).</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_writing_groovy_scripts_and_running_applications"><a class="link" href="#_writing_groovy_scripts_and_running_applications">Writing Groovy Scripts and Running Applications</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud CLI has support for most of the Spring Cloud declarative
|
||||
features, such as the <code>@Enable*</code> class of annotations. For example,
|
||||
here is a fully functional Eureka server</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">app.groovy</div>
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-groovy hljs" data-lang="groovy">@EnableEurekaServer
|
||||
class Eureka {}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>which you can run from the command line like this</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>$ spring run app.groovy</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>To include additional dependencies, often it suffices just to add the
|
||||
appropriate feature-enabling annotation, e.g. <code>@EnableConfigServer</code>,
|
||||
<code>@EnableOAuth2Sso</code> or <code>@EnableEurekaClient</code>. To manually include a
|
||||
dependency you can use a <code>@Grab</code> 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:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">app.groovy</div>
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-groovy hljs" data-lang="groovy">@Grab('spring-cloud-starter-bus-amqp')
|
||||
@RestController
|
||||
class Service {
|
||||
@RequestMapping('/')
|
||||
def home() { [message: 'Hello'] }
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_encryption_and_decryption"><a class="link" href="#_encryption_and_decryption">Encryption and Decryption</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>$ spring encrypt mysecret --key foo
|
||||
682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bda
|
||||
$ spring decrypt --key foo 682bc583f4641835fa2db009355293665d2647dade3375c0ee201de2a49f7bda
|
||||
mysecret</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre>$ spring encrypt mysecret --key @${HOME}/.ssh/id_rsa.pub
|
||||
AQAjPgt3eFZQXwt8tsHAVv/QHiY5sI2dRcR+...</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="js/tocbot/tocbot.min.js"></script>
|
||||
<script type="text/javascript" src="js/toc.js"></script>
|
||||
<link rel="stylesheet" href="js/highlight/styles/atom-one-dark-reasonable.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
<title>Page Redirection</title>
|
||||
|
||||
If you are not redirected automatically, follow the <a href='https://cloud.spring.io/spring-cloud-cli/reference/html/'>link to latest snapshot documentation</a>
|
||||
|
||||
Reference in New Issue
Block a user