Update for 1.3.2
This commit is contained in:
@@ -21,20 +21,20 @@ https://github.com/spring-projects/spring-boot[Spring Boot CLI]
|
||||
(1.5.2 or better):
|
||||
|
||||
$ spring version
|
||||
Spring CLI v1.5.3.BUILD-SNAPSHOT
|
||||
Spring CLI v1.5.3.RELEASE
|
||||
|
||||
E.g. for SDKMan users
|
||||
|
||||
```
|
||||
$ sdk install springboot 1.5.3.BUILD-SNAPSHOT
|
||||
$ sdk use springboot 1.5.3.BUILD-SNAPSHOT
|
||||
$ sdk install springboot 1.5.3.RELEASE
|
||||
$ sdk use springboot 1.5.3.RELEASE
|
||||
```
|
||||
|
||||
and install the Spring Cloud plugin
|
||||
|
||||
```
|
||||
$ mvn install
|
||||
$ spring install org.springframework.cloud:spring-cloud-cli:1.3.1.BUILD-SNAPSHOT
|
||||
$ spring install org.springframework.cloud:spring-cloud-cli:1.3.2.RELEASE
|
||||
```
|
||||
|
||||
IMPORTANT: **Prerequisites:** to use the encryption and decryption features
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-cli-parent</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Cloud Cli Docs</name>
|
||||
|
||||
@@ -4,20 +4,20 @@ https://github.com/spring-projects/spring-boot[Spring Boot CLI]
|
||||
(1.5.2 or better):
|
||||
|
||||
$ spring version
|
||||
Spring CLI v1.5.3.BUILD-SNAPSHOT
|
||||
Spring CLI v1.5.3.RELEASE
|
||||
|
||||
E.g. for SDKMan users
|
||||
|
||||
```
|
||||
$ sdk install springboot 1.5.3.BUILD-SNAPSHOT
|
||||
$ sdk use springboot 1.5.3.BUILD-SNAPSHOT
|
||||
$ sdk install springboot 1.5.3.RELEASE
|
||||
$ sdk use springboot 1.5.3.RELEASE
|
||||
```
|
||||
|
||||
and install the Spring Cloud plugin
|
||||
|
||||
```
|
||||
$ mvn install
|
||||
$ spring install org.springframework.cloud:spring-cloud-cli:1.3.1.BUILD-SNAPSHOT
|
||||
$ spring install org.springframework.cloud:spring-cloud-cli:1.3.2.RELEASE
|
||||
```
|
||||
|
||||
IMPORTANT: **Prerequisites:** to use the encryption and decryption features
|
||||
|
||||
4
pom.xml
4
pom.xml
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-cli-parent</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-build</artifactId>
|
||||
@@ -104,7 +104,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Dalston.BUILD-SNAPSHOT</version>
|
||||
<version>Dalston.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-cli-parent</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-cli</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>spring-cloud-cli</name>
|
||||
@@ -14,7 +14,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-cli-parent</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.boot.cli.compiler.GenericBomAstTransformation;
|
||||
@GroovyASTTransformation(phase = CompilePhase.CONVERSION)
|
||||
public class SpringCloudBomAstTransformation extends GenericBomAstTransformation {
|
||||
|
||||
private static final String SPRING_CLOUD_VERSION = "Dalston.BUILD-SNAPSHOT";
|
||||
private static final String SPRING_CLOUD_VERSION = "Dalston.RELEASE";
|
||||
|
||||
@Override
|
||||
protected String getBomModule() {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-launcher</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>spring-cloud-launcher</name>
|
||||
@@ -14,7 +14,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-cli-parent</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-launcher</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -51,7 +51,7 @@ public class LauncherCommand extends OptionParsingCommand {
|
||||
|
||||
public static final Log log = LogFactory.getLog(LauncherCommand.class);
|
||||
|
||||
private static final String DEFAULT_VERSION = "1.3.1.BUILD-SNAPSHOT";
|
||||
private static final String DEFAULT_VERSION = "1.3.2.RELEASE";
|
||||
|
||||
private static final Collection<HelpExample> EXAMPLES = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-launcher</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-launcher</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-launcher</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-deployer.version>1.1.4.RELEASE</spring-cloud-deployer.version>
|
||||
<spring-cloud-deployer-thin.version>1.0.0.RELEASE</spring-cloud-deployer-thin.version>
|
||||
<spring-cloud-deployer-thin.version>1.0.1.RELEASE</spring-cloud-deployer-thin.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@@ -49,7 +49,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-deployer-local</artifactId>
|
||||
<artifactId>spring-cloud-deployer-thin</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
|
||||
@@ -179,6 +179,7 @@ public class Deployer {
|
||||
}
|
||||
}
|
||||
appDefProps.putAll(deployable.getApplicationProperties());
|
||||
appDefProps.putAll(getThinProperties(deployable.getProperties()));
|
||||
Map<String, String> map = extractProperties("/" + deployable.getName() + ".yml");
|
||||
for (String key : map.keySet()) {
|
||||
appDefProps.put(key, map.get(key));
|
||||
@@ -222,6 +223,17 @@ public class Deployer {
|
||||
return id;
|
||||
}
|
||||
|
||||
private Map<String, String> getThinProperties(
|
||||
Map<String, String> properties) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
for (String key : properties.keySet()) {
|
||||
if (key.startsWith(AppDeployer.PREFIX + "thin.")) {
|
||||
map.put(key, properties.get(key));
|
||||
}
|
||||
}
|
||||
return map ;
|
||||
}
|
||||
|
||||
private boolean shouldDeploy(Deployable deployable, DeployerProperties properties) {
|
||||
return shouldDeploy(deployable.getName(), properties);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class DeployerApplication {
|
||||
private static final Logger logger = LoggerFactory
|
||||
.getLogger(DeployerApplication.class);
|
||||
|
||||
private static final String DEFAULT_VERSION = "1.3.2.BUILD-SNAPSHOT";
|
||||
private static final String DEFAULT_VERSION = "1.3.2.RELEASE";
|
||||
|
||||
private String[] args;
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
exclusions.spring-cloud-deployer-local: org.springframework.cloud:spring-cloud-deployer-thin
|
||||
dependencies.spring-cloud-deplyer-thin: org.springframework.cloud:spring-cloud-deployer-local
|
||||
@@ -97,26 +97,32 @@ spring:
|
||||
launcher:
|
||||
deployables:
|
||||
configserver:
|
||||
properties:
|
||||
spring.cloud.deployer.thin.profile: rabbit
|
||||
application-properties:
|
||||
thin.profile: rabbit
|
||||
spring.cloud.bus.enabled: true
|
||||
eureka:
|
||||
properties:
|
||||
spring.cloud.deployer.thin.profile: rabbit
|
||||
application-properties:
|
||||
spring.cloud.bus.enabled: true
|
||||
thin.profile: rabbit
|
||||
h2:
|
||||
properties:
|
||||
spring.cloud.deployer.thin.profile: rabbit
|
||||
application-properties:
|
||||
spring.cloud.bus.enabled: true
|
||||
thin.profile: rabbit
|
||||
dataflow:
|
||||
properties:
|
||||
spring.cloud.deployer.thin.profile: rabbit
|
||||
application-properties:
|
||||
spring.cloud.bus.enabled: true
|
||||
thin.profile: rabbit
|
||||
hystrixdashboard:
|
||||
properties:
|
||||
spring.cloud.deployer.thin.profile: rabbit
|
||||
application-properties:
|
||||
spring.cloud.bus.enabled: true
|
||||
thin.profile: rabbit
|
||||
zipkin:
|
||||
properties:
|
||||
spring.cloud.deployer.thin.profile: rabbit
|
||||
application-properties:
|
||||
spring.cloud.bus.enabled: true
|
||||
thin.profile: rabbit
|
||||
spring.cloud.bus.enabled: true
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.launcher.deployer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.junit.Assume;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
|
||||
import org.springframework.boot.loader.thin.ArchiveUtils;
|
||||
import org.springframework.boot.loader.tools.LogbackInitializer;
|
||||
import org.springframework.cloud.deployer.spi.app.DeploymentState;
|
||||
import org.springframework.cloud.deployer.spi.core.AppDefinition;
|
||||
import org.springframework.cloud.deployer.spi.core.AppDeploymentRequest;
|
||||
import org.springframework.cloud.deployer.thin.ThinJarAppDeployer;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
public class LauncherAppDeployerTests {
|
||||
|
||||
static {
|
||||
LogbackInitializer.initialize();
|
||||
}
|
||||
|
||||
private static ThinJarAppDeployer deployer = new ThinJarAppDeployer();
|
||||
private static String resource;
|
||||
|
||||
@BeforeClass
|
||||
public static void skip() {
|
||||
try {
|
||||
resource = "maven://org.springframework.cloud.launcher:spring-cloud-launcher-configserver:"
|
||||
+ new DeployerApplication().getVersion();
|
||||
ArchiveUtils.getArchiveRoot(ArchiveUtils.getArchive(resource));
|
||||
}
|
||||
catch (Exception e) {
|
||||
Assume.assumeNoException(
|
||||
"Could not locate jar for tests. Please build spring-cloud-cli locally first.",
|
||||
e);
|
||||
}
|
||||
}
|
||||
|
||||
@Parameterized.Parameters
|
||||
public static List<Object[]> data() {
|
||||
// Repeat a couple of times to ensure it's consistent
|
||||
return Arrays.asList(new Object[2][0]);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rabbit() throws Exception {
|
||||
String first = deploy(resource, "spring.cloud.deployer.thin.profile=rabbit", "");
|
||||
// Deployment is blocking so it either failed or succeeded.
|
||||
assertThat(deployer.status(first).getState()).isEqualTo(DeploymentState.deployed);
|
||||
deployer.undeploy(first);
|
||||
}
|
||||
|
||||
private String deploy(String jarName, String deployment, String application, String... args)
|
||||
throws Exception {
|
||||
Resource resource = new FileSystemResource(
|
||||
ArchiveUtils.getArchiveRoot(ArchiveUtils.getArchive(jarName)));
|
||||
AppDefinition definition = new AppDefinition(resource.getFilename(),
|
||||
properties(application));
|
||||
AppDeploymentRequest request = new AppDeploymentRequest(definition, resource,
|
||||
properties(deployment), Arrays.asList(args));
|
||||
String deployed = deployer.deploy(request);
|
||||
return deployed;
|
||||
}
|
||||
|
||||
private Map<String, String> properties(String properties) {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
Properties props = StringUtils.splitArrayElementsIntoProperties(
|
||||
StringUtils.commaDelimitedListToStringArray(properties), "=");
|
||||
if (props != null) {
|
||||
for (Object name : props.keySet()) {
|
||||
String key = (String) name;
|
||||
map.put(key, props.getProperty(key));
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-launcher</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-launcher</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-launcher</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-launcher</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-launcher</artifactId>
|
||||
<version>1.3.2.BUILD-SNAPSHOT</version>
|
||||
<version>1.3.2.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
Reference in New Issue
Block a user