Added a guard for non spring cloud projects docs update

fixes gh-177
This commit is contained in:
Marcin Grzejszczak
2020-03-06 09:27:23 +01:00
parent 731d68ef50
commit 2d77d2f2a4
2 changed files with 46 additions and 10 deletions

View File

@@ -62,6 +62,12 @@ class SpringCloudCustomProjectDocumentationUpdater
@Override
public File updateDocsRepoForReleaseTrain(File clonedDocumentationProject,
ProjectVersion currentProject, Projects projects, String bomBranch) {
if (!currentProject.projectName.startsWith("spring-cloud")) {
log.info(
"Skipping updating docs for project [{}] that does not start with spring-cloud prefix",
currentProject.projectName);
return clonedDocumentationProject;
}
log.debug("Cloning the doc project to [{}]", clonedDocumentationProject);
ProjectVersion releaseTrainProject = new ProjectVersion(
this.releaserProperties.getMetaRelease().getReleaseTrainProjectName(),
@@ -91,6 +97,12 @@ class SpringCloudCustomProjectDocumentationUpdater
currentProject.projectName, projects);
return clonedDocumentationProject;
}
if (!currentProject.projectName.startsWith("spring-cloud")) {
log.info(
"Skipping updating docs for project [{}] that does not start with spring-cloud prefix",
currentProject.projectName);
return clonedDocumentationProject;
}
log.info("Updating link to documentation for project [{}]",
currentProject.projectName);
ProjectVersion currentProjectVersion = projects
@@ -158,16 +170,6 @@ class SpringCloudCustomProjectDocumentationUpdater
return last > 0 ? path.substring(last + 1) : path;
}
private String concreteVersionFolder(ProjectVersion projectVersion) {
String projectName = projectVersion.projectName;
boolean releaseTrain = projectVersion.isReleaseTrain();
// release train -> static/Hoxton.SR2/
// project -> static/spring-cloud-sleuth/1.2.3.RELEASE/
String prefix = releaseTrain ? projectVersion.version
: (projectName + "/" + projectVersion.version);
return prefix + "/";
}
private File pushChanges(File docsRepo) {
this.gitHandler.pushCurrentBranch(docsRepo);
log.info("Committed and pushed changes to the documentation project");