Bumped Boot & Fixed release train command execution; fixes gh-118

This commit is contained in:
Marcin Grzejszczak
2019-01-23 13:52:56 +01:00
parent d57d8f98e7
commit 0bcb4e8bc2
6 changed files with 42 additions and 15 deletions

View File

@@ -12,7 +12,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>2.0.4.RELEASE</version>
<version>2.1.2.RELEASE</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
@@ -24,7 +24,7 @@
</modules>
<properties>
<spring-cloud-bom.version>Finchley.RELEASE</spring-cloud-bom.version>
<spring-cloud-bom.version>Greenwich.RELEASE</spring-cloud-bom.version>
</properties>
<dependencyManagement>

View File

@@ -630,7 +630,7 @@ public class ReleaserProperties implements Serializable {
/**
* Command to be executed to generate release train documentation
*/
private String generateReleaseTrainDocsCommand = "./release_train.sh --retrieveversions --version {{version}} --ghpages --auto";
private String generateReleaseTrainDocsCommand = "bash release_train.sh --retrieveversions --version {{version}} --ghpages --auto";
public static final String SYSTEM_PROPS_PLACEHOLDER = "{{systemProps}}";

View File

@@ -16,9 +16,7 @@
package org.springframework.cloud.release.internal.spring;
import org.springframework.context.ApplicationEvent;
class BuildCompleted extends ApplicationEvent {
class BuildCompleted extends ReleaserTask {
/**
* Create a new ApplicationEvent.

View File

@@ -0,0 +1,25 @@
/*
* Copyright 2013-2019 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.release.internal.spring;
import org.springframework.context.ApplicationEvent;
class ReleaserTask extends ApplicationEvent {
ReleaserTask(Object source) {
super(source);
}
}

View File

@@ -26,24 +26,22 @@ import com.jakewharton.fliptables.FlipTableConverters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.EventListener;
import org.springframework.context.ApplicationListener;
import org.springframework.core.NestedExceptionUtils;
import org.springframework.util.StringUtils;
class TaskCollector {
class TaskCollector implements ApplicationListener<ReleaserTask> {
private static final Logger log = LoggerFactory.getLogger(TaskCollector.class);
private final Queue<TaskCompleted> completedTasks = new ArrayBlockingQueue<>(300);
@EventListener
public void handleTaskCompleted(TaskCompleted taskCompleted) {
private void handleTaskCompleted(TaskCompleted taskCompleted) {
this.completedTasks.add(taskCompleted);
log.info("Completed task: " + taskCompleted);
}
@EventListener
public void handleBuildCompleted(BuildCompleted buildCompleted) {
private void handleBuildCompleted(BuildCompleted buildCompleted) {
log.info("Build has finished. Will summarize the results");
List<Table> table = this.completedTasks.stream()
.map(task -> new Table(task.projectName, task.taskAndException))
@@ -74,6 +72,14 @@ class TaskCollector {
}
}
@Override
public void onApplicationEvent(ReleaserTask event) {
if (event instanceof TaskCompleted) {
handleTaskCompleted((TaskCompleted) event);
} else if (event instanceof BuildCompleted) {
handleBuildCompleted((BuildCompleted) event);
}
}
}
class Table {

View File

@@ -16,9 +16,7 @@
package org.springframework.cloud.release.internal.spring;
import org.springframework.context.ApplicationEvent;
class TaskCompleted extends ApplicationEvent {
class TaskCompleted extends ReleaserTask {
final String projectName;
final TaskAndException taskAndException;