Bumped Boot & Fixed release train command execution; fixes gh-118
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user