WIP
This commit is contained in:
@@ -83,14 +83,9 @@ final class Tasks {
|
||||
static Task UPDATE_DOCUMENTATION = task("updateDocumentation", "ud",
|
||||
"UPDATE DOCUMENTATION", "Updating documentation repository", args -> {
|
||||
args.releaser.updateDocumentationRepository(args.properties,
|
||||
args.versionFromScRelease);
|
||||
args.projects, args.versionFromScRelease);
|
||||
}, TaskType.POST_RELEASE);
|
||||
|
||||
@Deprecated
|
||||
static Task UPDATE_SPRING_PROJECT_PAGE = task("updateSpringProjectPage", "up",
|
||||
"UPDATE SPRING PROJECT PAGE", "Updating Spring Project page", args -> {
|
||||
args.releaser.updateSpringProjectPage(args.projects);
|
||||
}, TaskType.POST_RELEASE);
|
||||
static Task RUN_UPDATED_SAMPLES = task("runUpdatedSample", "ru",
|
||||
"UPDATE AND RUN SAMPLES",
|
||||
"Updates the sample project with versions and runs samples", args -> {
|
||||
|
||||
@@ -16,14 +16,10 @@
|
||||
|
||||
package org.springframework.cloud.release.internal.docs;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import edu.emory.mathcs.backport.java.util.Collections;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.cloud.release.internal.template.TemplateGenerator;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
@@ -37,18 +33,4 @@ public class TestDocumentationUpdater extends DocumentationUpdater {
|
||||
Collections.singletonList(updater)), testRelease);
|
||||
}
|
||||
|
||||
public static class TestReleaseContentsUpdater extends ReleaseTrainContentsUpdater {
|
||||
|
||||
public TestReleaseContentsUpdater(ReleaserProperties properties,
|
||||
ProjectGitHandler handler, TemplateGenerator templateGenerator) {
|
||||
super(properties, handler, templateGenerator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public File updateProjectRepo(Projects projects) {
|
||||
return super.updateProjectRepo(projects);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* https://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.docs;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.template.TemplateGenerator;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
public class TestReleaseContentsUpdater extends ReleaseTrainContentsUpdater {
|
||||
|
||||
public TestReleaseContentsUpdater(ReleaserProperties properties,
|
||||
ProjectGitHandler handler, TemplateGenerator templateGenerator) {
|
||||
super(properties, handler, templateGenerator);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -56,6 +56,7 @@ import org.springframework.cloud.release.internal.buildsystem.TestPomReader;
|
||||
import org.springframework.cloud.release.internal.buildsystem.TestUtils;
|
||||
import org.springframework.cloud.release.internal.docs.DocumentationUpdater;
|
||||
import org.springframework.cloud.release.internal.docs.TestDocumentationUpdater;
|
||||
import org.springframework.cloud.release.internal.docs.TestReleaseContentsUpdater;
|
||||
import org.springframework.cloud.release.internal.git.GitTestUtils;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.github.ProjectGitHubHandler;
|
||||
@@ -93,8 +94,6 @@ public class AcceptanceTests {
|
||||
|
||||
File documentationFolder;
|
||||
|
||||
File cloudProjectFolder;
|
||||
|
||||
TestProjectGitHubHandler gitHandler;
|
||||
|
||||
NonAssertingTestProjectGitHandler nonAssertingGitHandler;
|
||||
@@ -461,7 +460,8 @@ public class AcceptanceTests {
|
||||
|
||||
private void thenDocumentationWasUpdated() {
|
||||
BDDMockito.then(this.documentationUpdater).should().updateDocsRepo(
|
||||
BDDMockito.any(ProjectVersion.class), BDDMockito.anyString());
|
||||
BDDMockito.any(Projects.class), BDDMockito.any(ProjectVersion.class),
|
||||
BDDMockito.anyString());
|
||||
}
|
||||
|
||||
private void thenDocumentationWasNotUpdated() {
|
||||
@@ -791,15 +791,17 @@ public class AcceptanceTests {
|
||||
GradleUpdater gradleUpdater = new GradleUpdater(properties);
|
||||
SaganUpdater saganUpdater = new SaganUpdater(this.saganClient,
|
||||
this.releaserProperties);
|
||||
TestReleaseContentsUpdater testReleaseContentsUpdater = new TestReleaseContentsUpdater(properties, gitHandler,
|
||||
templateGenerator);
|
||||
DocumentationUpdater documentationUpdater = new TestDocumentationUpdater(
|
||||
properties,
|
||||
SpringCloudDocsAccessor.testUpdater(gitHandler, "Brixton.SR1"),
|
||||
gitHandler, new TestDocumentationUpdater.TestReleaseContentsUpdater(
|
||||
properties, gitHandler, templateGenerator)) {
|
||||
gitHandler, testReleaseContentsUpdater) {
|
||||
@Override
|
||||
public File updateDocsRepo(ProjectVersion currentProject,
|
||||
public File updateDocsRepo(Projects projects, ProjectVersion currentProject,
|
||||
String bomReleaseBranch) {
|
||||
File file = super.updateDocsRepo(currentProject, bomReleaseBranch);
|
||||
File file = super.updateDocsRepo(projects, currentProject,
|
||||
bomReleaseBranch);
|
||||
AcceptanceTests.this.documentationFolder = file;
|
||||
return file;
|
||||
}
|
||||
@@ -830,20 +832,12 @@ public class AcceptanceTests {
|
||||
.spy(new TestDocumentationUpdater(properties,
|
||||
SpringCloudDocsAccessor.testUpdater(nonAssertingGitHandler,
|
||||
"Brixton.SR1"),
|
||||
nonAssertingGitHandler,
|
||||
new TestDocumentationUpdater.TestReleaseContentsUpdater(
|
||||
properties, nonAssertingGitHandler, templateGenerator) {
|
||||
@Override
|
||||
public File updateProjectRepo(Projects projects) {
|
||||
File file = super.updateProjectRepo(projects);
|
||||
AcceptanceTests.this.cloudProjectFolder = file;
|
||||
return file;
|
||||
}
|
||||
}) {
|
||||
nonAssertingGitHandler, new TestReleaseContentsUpdater(properties,
|
||||
nonAssertingGitHandler, templateGenerator)) {
|
||||
@Override
|
||||
public File updateDocsRepo(ProjectVersion currentProject,
|
||||
String bomReleaseBranch) {
|
||||
File file = super.updateDocsRepo(currentProject,
|
||||
public File updateDocsRepo(Projects projects,
|
||||
ProjectVersion currentProject, String bomReleaseBranch) {
|
||||
File file = super.updateDocsRepo(projects, currentProject,
|
||||
bomReleaseBranch);
|
||||
AcceptanceTests.this.documentationFolder = file;
|
||||
return file;
|
||||
|
||||
Reference in New Issue
Block a user