Added the buildsystem abstraction
This commit is contained in:
@@ -22,15 +22,16 @@ import java.util.List;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.buildsystem.GradleUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.docs.DocumentationUpdater;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.gradle.GradleUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProcessedProject;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.post.PostReleaseActions;
|
||||
import org.springframework.cloud.release.internal.project.ProjectBuilder;
|
||||
import org.springframework.cloud.release.internal.github.ProjectGitHubHandler;
|
||||
import org.springframework.cloud.release.internal.postrelease.PostReleaseActions;
|
||||
import org.springframework.cloud.release.internal.project.ProcessedProject;
|
||||
import org.springframework.cloud.release.internal.project.ProjectCommandExecutor;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.cloud.release.internal.sagan.SaganUpdater;
|
||||
import org.springframework.cloud.release.internal.tech.MakeBuildUnstableException;
|
||||
import org.springframework.cloud.release.internal.template.TemplateGenerator;
|
||||
@@ -51,10 +52,12 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
|
||||
private final ProjectPomUpdater projectPomUpdater;
|
||||
|
||||
private final ProjectBuilder projectBuilder;
|
||||
private final ProjectCommandExecutor projectCommandExecutor;
|
||||
|
||||
private final ProjectGitHandler projectGitHandler;
|
||||
|
||||
private final ProjectGitHubHandler projectGitHubHandler;
|
||||
|
||||
private final TemplateGenerator templateGenerator;
|
||||
|
||||
private final GradleUpdater gradleUpdater;
|
||||
@@ -66,15 +69,18 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
private final PostReleaseActions postReleaseActions;
|
||||
|
||||
public Releaser(ReleaserProperties releaserProperties,
|
||||
ProjectPomUpdater projectPomUpdater, ProjectBuilder projectBuilder,
|
||||
ProjectGitHandler projectGitHandler, TemplateGenerator templateGenerator,
|
||||
GradleUpdater gradleUpdater, SaganUpdater saganUpdater,
|
||||
DocumentationUpdater documentationUpdater,
|
||||
ProjectPomUpdater projectPomUpdater,
|
||||
ProjectCommandExecutor projectCommandExecutor,
|
||||
ProjectGitHandler projectGitHandler,
|
||||
ProjectGitHubHandler projectGitHubHandler,
|
||||
TemplateGenerator templateGenerator, GradleUpdater gradleUpdater,
|
||||
SaganUpdater saganUpdater, DocumentationUpdater documentationUpdater,
|
||||
PostReleaseActions postReleaseActions) {
|
||||
this.releaserProperties = releaserProperties;
|
||||
this.projectPomUpdater = projectPomUpdater;
|
||||
this.projectBuilder = projectBuilder;
|
||||
this.projectCommandExecutor = projectCommandExecutor;
|
||||
this.projectGitHandler = projectGitHandler;
|
||||
this.projectGitHubHandler = projectGitHubHandler;
|
||||
this.templateGenerator = templateGenerator;
|
||||
this.gradleUpdater = gradleUpdater;
|
||||
this.saganUpdater = saganUpdater;
|
||||
@@ -110,7 +116,7 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
}
|
||||
|
||||
public void buildProject(ProjectVersion versionFromScRelease) {
|
||||
this.projectBuilder.build(versionFromScRelease);
|
||||
this.projectCommandExecutor.build(versionFromScRelease);
|
||||
log.info("\nProject was successfully built");
|
||||
}
|
||||
|
||||
@@ -120,12 +126,12 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
}
|
||||
|
||||
public void deploy(ProjectVersion versionFromScRelease) {
|
||||
this.projectBuilder.deploy(versionFromScRelease);
|
||||
this.projectCommandExecutor.deploy(versionFromScRelease);
|
||||
log.info("\nThe artifact was deployed successfully");
|
||||
}
|
||||
|
||||
public void publishDocs(ProjectVersion changedVersion) {
|
||||
this.projectBuilder.publishDocs(changedVersion.version);
|
||||
this.projectCommandExecutor.publishDocs(changedVersion.version);
|
||||
log.info("\nThe docs were published successfully");
|
||||
}
|
||||
|
||||
@@ -181,7 +187,7 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.projectGitHandler.closeMilestone(releaseVersion);
|
||||
this.projectGitHubHandler.closeMilestone(releaseVersion);
|
||||
log.info("\nSuccessfully closed milestone");
|
||||
}
|
||||
catch (Exception ex) {
|
||||
@@ -267,7 +273,7 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
private Exception createIssueInSpringGuides(ProjectVersion releaseVersion,
|
||||
Projects projects) {
|
||||
try {
|
||||
this.projectGitHandler.createIssueInSpringGuides(projects, releaseVersion);
|
||||
this.projectGitHubHandler.createIssueInSpringGuides(projects, releaseVersion);
|
||||
log.info("\nSuccessfully created an issue in Spring Guides");
|
||||
return null;
|
||||
}
|
||||
@@ -281,7 +287,8 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
private Exception createIssueInStartSpringIo(ProjectVersion releaseVersion,
|
||||
Projects projects) {
|
||||
try {
|
||||
this.projectGitHandler.createIssueInStartSpringIo(projects, releaseVersion);
|
||||
this.projectGitHubHandler.createIssueInStartSpringIo(projects,
|
||||
releaseVersion);
|
||||
log.info("\nSuccessfully created an issue in start.spring.io");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import org.apache.commons.lang.SerializationUtils;
|
||||
|
||||
@@ -55,6 +56,8 @@ public class ReleaserProperties implements Serializable {
|
||||
|
||||
private Maven maven = new Maven();
|
||||
|
||||
private Bash bash = new Bash();
|
||||
|
||||
private Gradle gradle = new Gradle();
|
||||
|
||||
private Sagan sagan = new Sagan();
|
||||
@@ -112,6 +115,14 @@ public class ReleaserProperties implements Serializable {
|
||||
this.gradle = gradle;
|
||||
}
|
||||
|
||||
public Bash getBash() {
|
||||
return bash;
|
||||
}
|
||||
|
||||
public void setBash(Bash bash) {
|
||||
this.bash = bash;
|
||||
}
|
||||
|
||||
public Map<String, String> getFixedVersions() {
|
||||
return this.fixedVersions;
|
||||
}
|
||||
@@ -840,6 +851,121 @@ public class ReleaserProperties implements Serializable {
|
||||
|
||||
}
|
||||
|
||||
public static class Bash implements Serializable {
|
||||
|
||||
/**
|
||||
* Placeholder for system properties.
|
||||
*/
|
||||
public static final String SYSTEM_PROPS_PLACEHOLDER = "{{systemProps}}";
|
||||
|
||||
/**
|
||||
* Command to be executed to build the project.
|
||||
*/
|
||||
private String buildCommand = "echo \"{{systemProps}}\"";
|
||||
|
||||
/**
|
||||
* Command to be executed to deploy a built project.
|
||||
*/
|
||||
private String deployCommand = "echo \"{{systemProps}}\"";
|
||||
|
||||
/**
|
||||
* Command to be executed to build and deploy guides project only.
|
||||
*/
|
||||
private String deployGuidesCommand = "echo \"{{systemProps}}\"";
|
||||
|
||||
/**
|
||||
* Command to be executed to publish documentation. If present "{{version}}" will
|
||||
* be replaced by the provided version.
|
||||
*/
|
||||
private String[] publishDocsCommands = { "mkdir -p target",
|
||||
"echo \"{{version}}\"" };
|
||||
|
||||
/**
|
||||
* Command to be executed to generate release train documentation.
|
||||
*/
|
||||
private String generateReleaseTrainDocsCommand = "echo \"{{version}}\"";
|
||||
|
||||
/**
|
||||
* Additional system properties that should be passed to the build / deploy
|
||||
* commands. If present in other commands "{{systemProps}}" will be substituted
|
||||
* with this property.
|
||||
*/
|
||||
private String systemProperties = "";
|
||||
|
||||
/**
|
||||
* Max wait time in minutes for the process to finish.
|
||||
*/
|
||||
private long waitTimeInMinutes = 20;
|
||||
|
||||
public String getBuildCommand() {
|
||||
return this.buildCommand;
|
||||
}
|
||||
|
||||
public void setBuildCommand(String buildCommand) {
|
||||
this.buildCommand = buildCommand;
|
||||
}
|
||||
|
||||
public long getWaitTimeInMinutes() {
|
||||
return this.waitTimeInMinutes;
|
||||
}
|
||||
|
||||
public void setWaitTimeInMinutes(long waitTimeInMinutes) {
|
||||
this.waitTimeInMinutes = waitTimeInMinutes;
|
||||
}
|
||||
|
||||
public String getDeployCommand() {
|
||||
return this.deployCommand;
|
||||
}
|
||||
|
||||
public void setDeployCommand(String deployCommand) {
|
||||
this.deployCommand = deployCommand;
|
||||
}
|
||||
|
||||
public String getDeployGuidesCommand() {
|
||||
return this.deployGuidesCommand;
|
||||
}
|
||||
|
||||
public void setDeployGuidesCommand(String deployGuidesCommand) {
|
||||
this.deployGuidesCommand = deployGuidesCommand;
|
||||
}
|
||||
|
||||
public String[] getPublishDocsCommands() {
|
||||
return this.publishDocsCommands;
|
||||
}
|
||||
|
||||
public void setPublishDocsCommands(String[] publishDocsCommands) {
|
||||
this.publishDocsCommands = publishDocsCommands;
|
||||
}
|
||||
|
||||
public String getGenerateReleaseTrainDocsCommand() {
|
||||
return this.generateReleaseTrainDocsCommand;
|
||||
}
|
||||
|
||||
public void setGenerateReleaseTrainDocsCommand(
|
||||
String generateReleaseTrainDocsCommand) {
|
||||
this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand;
|
||||
}
|
||||
|
||||
public String getSystemProperties() {
|
||||
return this.systemProperties;
|
||||
}
|
||||
|
||||
public void setSystemProperties(String systemProperties) {
|
||||
this.systemProperties = systemProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Maven{" + "buildCommand='" + this.buildCommand + '\''
|
||||
+ ", deployCommand='" + this.deployCommand + '\''
|
||||
+ ", publishDocsCommands=" + Arrays.toString(this.publishDocsCommands)
|
||||
+ "generateReleaseTrainDocsCommand='"
|
||||
+ this.generateReleaseTrainDocsCommand + '\'' + ", waitTimeInMinutes="
|
||||
+ this.waitTimeInMinutes + '}';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class Gradle implements Serializable {
|
||||
|
||||
/**
|
||||
@@ -872,6 +998,106 @@ public class ReleaserProperties implements Serializable {
|
||||
"^.*spring-cloud-contract-maven-plugin/target/.*$",
|
||||
"^.*samples/standalone/[a-z]+/.*$");
|
||||
|
||||
/**
|
||||
* Placeholder for system properties.
|
||||
*/
|
||||
public static final String SYSTEM_PROPS_PLACEHOLDER = "{{systemProps}}";
|
||||
|
||||
/**
|
||||
* Command to be executed to build the project.
|
||||
*/
|
||||
private String buildCommand = "./gradlew clean build publishToMavenLocal {{systemProps}}";
|
||||
|
||||
/**
|
||||
* Command to be executed to deploy a built project.
|
||||
*/
|
||||
private String deployCommand = "./gradlew clean build publish {{systemProps}}";
|
||||
|
||||
/**
|
||||
* Command to be executed to build and deploy guides project only.
|
||||
*/
|
||||
private String deployGuidesCommand = "./gradlew clean build deployGuides {{systemProps}}";
|
||||
|
||||
/**
|
||||
* Command to be executed to publish documentation. If present "{{version}}" will
|
||||
* be replaced by the provided version.
|
||||
*/
|
||||
private String[] publishDocsCommands = { "echo 'TODO'" };
|
||||
|
||||
/**
|
||||
* Command to be executed to generate release train documentation.
|
||||
*/
|
||||
private String generateReleaseTrainDocsCommand = "echo 'TODO'";
|
||||
|
||||
/**
|
||||
* Additional system properties that should be passed to the build / deploy
|
||||
* commands. If present in other commands "{{systemProps}}" will be substituted
|
||||
* with this property.
|
||||
*/
|
||||
private String systemProperties = "";
|
||||
|
||||
/**
|
||||
* Max wait time in minutes for the process to finish.
|
||||
*/
|
||||
private long waitTimeInMinutes = 20;
|
||||
|
||||
public String getBuildCommand() {
|
||||
return this.buildCommand;
|
||||
}
|
||||
|
||||
public void setBuildCommand(String buildCommand) {
|
||||
this.buildCommand = buildCommand;
|
||||
}
|
||||
|
||||
public long getWaitTimeInMinutes() {
|
||||
return this.waitTimeInMinutes;
|
||||
}
|
||||
|
||||
public void setWaitTimeInMinutes(long waitTimeInMinutes) {
|
||||
this.waitTimeInMinutes = waitTimeInMinutes;
|
||||
}
|
||||
|
||||
public String getDeployCommand() {
|
||||
return this.deployCommand;
|
||||
}
|
||||
|
||||
public void setDeployCommand(String deployCommand) {
|
||||
this.deployCommand = deployCommand;
|
||||
}
|
||||
|
||||
public String getDeployGuidesCommand() {
|
||||
return this.deployGuidesCommand;
|
||||
}
|
||||
|
||||
public void setDeployGuidesCommand(String deployGuidesCommand) {
|
||||
this.deployGuidesCommand = deployGuidesCommand;
|
||||
}
|
||||
|
||||
public String[] getPublishDocsCommands() {
|
||||
return this.publishDocsCommands;
|
||||
}
|
||||
|
||||
public void setPublishDocsCommands(String[] publishDocsCommands) {
|
||||
this.publishDocsCommands = publishDocsCommands;
|
||||
}
|
||||
|
||||
public String getGenerateReleaseTrainDocsCommand() {
|
||||
return this.generateReleaseTrainDocsCommand;
|
||||
}
|
||||
|
||||
public void setGenerateReleaseTrainDocsCommand(
|
||||
String generateReleaseTrainDocsCommand) {
|
||||
this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand;
|
||||
}
|
||||
|
||||
public String getSystemProperties() {
|
||||
return this.systemProperties;
|
||||
}
|
||||
|
||||
public void setSystemProperties(String systemProperties) {
|
||||
this.systemProperties = systemProperties;
|
||||
}
|
||||
|
||||
public Map<String, String> getGradlePropsSubstitution() {
|
||||
return this.gradlePropsSubstitution;
|
||||
}
|
||||
@@ -891,8 +1117,17 @@ public class ReleaserProperties implements Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Gradle{" + "gradlePropsSubstitution=" + this.gradlePropsSubstitution
|
||||
+ ", ignoredGradleRegex=" + this.ignoredGradleRegex + '}';
|
||||
return new StringJoiner(", ", Gradle.class.getSimpleName() + "[", "]")
|
||||
.add("gradlePropsSubstitution=" + gradlePropsSubstitution)
|
||||
.add("ignoredGradleRegex=" + ignoredGradleRegex)
|
||||
.add("buildCommand='" + buildCommand + "'")
|
||||
.add("deployCommand='" + deployCommand + "'")
|
||||
.add("deployGuidesCommand='" + deployGuidesCommand + "'")
|
||||
.add("publishDocsCommands=" + Arrays.toString(publishDocsCommands))
|
||||
.add("generateReleaseTrainDocsCommand='"
|
||||
+ generateReleaseTrainDocsCommand + "'")
|
||||
.add("systemProperties='" + systemProperties + "'")
|
||||
.add("waitTimeInMinutes=" + waitTimeInMinutes).toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashSet;
|
||||
@@ -32,7 +32,10 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
|
||||
import static org.springframework.cloud.release.internal.pom.SpringCloudConstants.CLOUD_DEPENDENCIES_PARENT_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.buildsystem.SpringCloudConstants.BOOT_DEPENDENCIES_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.buildsystem.SpringCloudConstants.BOOT_STARTER_PARENT_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.buildsystem.SpringCloudConstants.CLOUD_DEPENDENCIES_PARENT_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.buildsystem.SpringCloudConstants.SPRING_BOOT;
|
||||
|
||||
/**
|
||||
* Parses the poms for a given project and populates versions from a release train.
|
||||
@@ -66,8 +69,7 @@ class BomParser {
|
||||
Versions allVersions() {
|
||||
Versions boot = bootVersion();
|
||||
Versions cloud = versionsFromBom();
|
||||
return new Versions(boot.bootVersion, cloud.scBuildVersion,
|
||||
allProjects(boot, cloud));
|
||||
return new Versions(this.properties, allProjects(boot, cloud));
|
||||
}
|
||||
|
||||
private Set<Project> allProjects(Versions boot, Versions cloud) {
|
||||
@@ -77,6 +79,7 @@ class BomParser {
|
||||
return allProjects;
|
||||
}
|
||||
|
||||
// TODO: [SPRING CLOUD]
|
||||
Versions bootVersion() {
|
||||
Model model = pom(this.pomWithBootStarterParent);
|
||||
if (model == null) {
|
||||
@@ -92,7 +95,11 @@ class BomParser {
|
||||
}
|
||||
String bootVersion = model.getParent().getVersion();
|
||||
log.debug("Boot version is equal to [{}]", bootVersion);
|
||||
return new Versions(bootVersion);
|
||||
Versions versions = new Versions(this.properties);
|
||||
versions.add(SPRING_BOOT, bootVersion);
|
||||
versions.add(BOOT_STARTER_PARENT_ARTIFACT_ID, bootVersion);
|
||||
versions.add(BOOT_DEPENDENCIES_ARTIFACT_ID, bootVersion);
|
||||
return versions;
|
||||
}
|
||||
|
||||
private Model pom(String pom) {
|
||||
@@ -113,6 +120,7 @@ class BomParser {
|
||||
if (model == null) {
|
||||
return Versions.EMPTY_VERSION;
|
||||
}
|
||||
// TODO: [SPRING CLOUD]
|
||||
String buildArtifact = model.getParent().getArtifactId();
|
||||
log.debug("[{}] artifact id is equal to [{}]",
|
||||
CLOUD_DEPENDENCIES_PARENT_ARTIFACT_ID, buildArtifact);
|
||||
@@ -129,7 +137,8 @@ class BomParser {
|
||||
projects.add(
|
||||
new Project(this.properties.getMetaRelease().getReleaseTrainProjectName(),
|
||||
releaseTrainProjectVersion));
|
||||
return new Versions(buildVersion, projects);
|
||||
projects.add(new Project("spring-cloud-build", buildVersion));
|
||||
return new Versions(this.properties, projects);
|
||||
}
|
||||
|
||||
private Predicate<Map.Entry<Object, Object>> propertyMatchesSCPattern() {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.gradle;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -37,8 +37,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.ReleaserPropertiesAware;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
@@ -69,10 +68,10 @@ public class GradleUpdater implements ReleaserPropertiesAware {
|
||||
}
|
||||
|
||||
private void processAllGradleProps(File projectRoot, Projects projects,
|
||||
ProjectVersion versionFromScRelease, boolean assertVersions) {
|
||||
ProjectVersion versionFromBom, boolean assertVersions) {
|
||||
try {
|
||||
Files.walkFileTree(projectRoot.toPath(), new GradlePropertiesWalker(
|
||||
this.properties, projects, versionFromScRelease, assertVersions));
|
||||
this.properties, projects, versionFromBom, assertVersions));
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new IllegalStateException(e);
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.ReleaserPropertiesAware;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
@@ -93,11 +94,10 @@ public class ProjectPomUpdater implements ReleaserPropertiesAware {
|
||||
public Projects retrieveVersionsFromReleaseTrainBom(String branch,
|
||||
boolean updateFixedVersions) {
|
||||
Versions versions = CACHE.computeIfAbsent(branch, s -> {
|
||||
File clonedScRelease = this.gitRepo.cloneReleaseTrainProject();
|
||||
this.gitRepo.checkout(clonedScRelease, branch);
|
||||
BomParser sCReleasePomParser = new BomParser(this.properties,
|
||||
clonedScRelease);
|
||||
return sCReleasePomParser.allVersions();
|
||||
File clonedBom = this.gitRepo.cloneReleaseTrainProject();
|
||||
this.gitRepo.checkout(clonedBom, branch);
|
||||
BomParser releaseTrainBomParser = new BomParser(this.properties, clonedBom);
|
||||
return releaseTrainBomParser.allVersions();
|
||||
});
|
||||
if (updateFixedVersions) {
|
||||
log.info("Will update the following versions manually [{}]",
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
@@ -25,6 +25,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.maven.model.Model;
|
||||
|
||||
import org.springframework.cloud.release.internal.project.ProjectCommandExecutor;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -60,27 +61,41 @@ public class ProjectVersion implements Comparable<ProjectVersion> {
|
||||
*/
|
||||
public final String version;
|
||||
|
||||
private final Model model;
|
||||
private final String groupId;
|
||||
|
||||
private final String artifactId;
|
||||
|
||||
public ProjectVersion(String projectName, String version) {
|
||||
this.projectName = nameWithoutParent(projectName);
|
||||
this.version = version;
|
||||
this.model = null;
|
||||
this.groupId = "";
|
||||
this.artifactId = "";
|
||||
}
|
||||
|
||||
public ProjectVersion(File project) {
|
||||
if (new File(project, "build.gradle").exists()) {
|
||||
ProjectVersion projectVersion = notMavenProject(project);
|
||||
ProjectVersion projectVersion = gradleProject(project);
|
||||
this.projectName = projectVersion.projectName;
|
||||
this.version = projectVersion.version;
|
||||
this.model = null;
|
||||
this.groupId = new ProjectCommandExecutor().groupId();
|
||||
this.artifactId = projectName;
|
||||
}
|
||||
else {
|
||||
PomReader pomReader = new PomReader();
|
||||
Model model = pomReader.readPom(project);
|
||||
this.projectName = nameWithoutParent(model.getArtifactId());
|
||||
this.version = model.getVersion();
|
||||
this.model = model;
|
||||
if (model != null) {
|
||||
this.projectName = nameWithoutParent(model.getArtifactId());
|
||||
this.version = model.getVersion();
|
||||
this.groupId = groupId(model);
|
||||
this.artifactId = model.getArtifactId();
|
||||
}
|
||||
else {
|
||||
ProjectVersion projectVersion = notMavenProject(project);
|
||||
this.projectName = projectVersion.projectName;
|
||||
this.version = projectVersion.version;
|
||||
this.groupId = projectVersion.groupId;
|
||||
this.artifactId = projectVersion.artifactId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +106,13 @@ public class ProjectVersion implements Comparable<ProjectVersion> {
|
||||
return new ProjectVersion(nameWithoutParent(name), version);
|
||||
}
|
||||
|
||||
public static ProjectVersion gradleProject(File file) {
|
||||
File parentFolder = file.getParentFile() != null ? file.getParentFile() : file;
|
||||
String name = parentFolder.getName();
|
||||
String version = new ProjectCommandExecutor().version();
|
||||
return new ProjectVersion(nameWithoutParent(name), version);
|
||||
}
|
||||
|
||||
private static String nameWithoutParent(String projectName) {
|
||||
boolean containsParent = projectName.endsWith("-parent");
|
||||
if (!containsParent) {
|
||||
@@ -99,6 +121,20 @@ public class ProjectVersion implements Comparable<ProjectVersion> {
|
||||
return projectName.substring(0, projectName.indexOf("-parent"));
|
||||
}
|
||||
|
||||
private String groupId(Model model) {
|
||||
if (model == null) {
|
||||
return "";
|
||||
}
|
||||
if (StringUtils.hasText(model.getGroupId())) {
|
||||
return model.getGroupId();
|
||||
}
|
||||
if (model.getParent() != null
|
||||
&& StringUtils.hasText(model.getParent().getGroupId())) {
|
||||
return model.getParent().getGroupId();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String bumpedVersion() {
|
||||
return bumpedVersion(assertVersion()).print();
|
||||
}
|
||||
@@ -192,17 +228,7 @@ public class ProjectVersion implements Comparable<ProjectVersion> {
|
||||
}
|
||||
|
||||
public String groupId() {
|
||||
if (this.model == null) {
|
||||
return "";
|
||||
}
|
||||
if (StringUtils.hasText(this.model.getGroupId())) {
|
||||
return this.model.getGroupId();
|
||||
}
|
||||
if (this.model.getParent() != null
|
||||
&& StringUtils.hasText(this.model.getParent().getGroupId())) {
|
||||
return this.model.getParent().getGroupId();
|
||||
}
|
||||
return "";
|
||||
return this.groupId;
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
@@ -363,13 +389,6 @@ public class ProjectVersion implements Comparable<ProjectVersion> {
|
||||
assertIfValid();
|
||||
}
|
||||
|
||||
private void assertIfValid() {
|
||||
if (isInvalid()) {
|
||||
throw new IllegalStateException(
|
||||
"Version is invalid. Should be of format [1.2.3.A] / [1.2.3-A] or [A.B] / [A-B]");
|
||||
}
|
||||
}
|
||||
|
||||
// Hoxton.RELEASE
|
||||
// Hoxton-RELEASE
|
||||
private SplitVersion(String major, String delimiter, String suffix) {
|
||||
@@ -385,6 +404,39 @@ public class ProjectVersion implements Comparable<ProjectVersion> {
|
||||
assertIfValid();
|
||||
}
|
||||
|
||||
private static String orDefault(String[] args, int argIndex) {
|
||||
return args.length > argIndex ? args[argIndex] : "";
|
||||
}
|
||||
|
||||
static SplitVersion hyphen(String major, String suffix) {
|
||||
return new SplitVersion(major, HYPHEN, suffix);
|
||||
}
|
||||
|
||||
static SplitVersion hyphen(String[] args) {
|
||||
return version(args, HYPHEN);
|
||||
}
|
||||
|
||||
static SplitVersion dot(String[] args) {
|
||||
return version(args, DOT);
|
||||
}
|
||||
|
||||
private static SplitVersion version(String[] args, String delimiter) {
|
||||
if (args.length == 2) {
|
||||
return new SplitVersion(args[0], "", "", delimiter, args[1]);
|
||||
}
|
||||
else if (args.length == 3) {
|
||||
return new SplitVersion(args[0], args[1], "", delimiter, args[2]);
|
||||
}
|
||||
return new SplitVersion(args, delimiter);
|
||||
}
|
||||
|
||||
private void assertIfValid() {
|
||||
if (isInvalid()) {
|
||||
throw new IllegalStateException(
|
||||
"Version is invalid. Should be of format [1.2.3.A] / [1.2.3-A] or [A.B] / [A-B]");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isInvalid() {
|
||||
return wrongReleaseTrainVersion() || wrongLibraryVersion() || wrongDelimiter()
|
||||
|| noSuffix();
|
||||
@@ -442,32 +494,6 @@ public class ProjectVersion implements Comparable<ProjectVersion> {
|
||||
BUILD_SNAPSHOT_SUFFIX);
|
||||
}
|
||||
|
||||
private static String orDefault(String[] args, int argIndex) {
|
||||
return args.length > argIndex ? args[argIndex] : "";
|
||||
}
|
||||
|
||||
static SplitVersion hyphen(String major, String suffix) {
|
||||
return new SplitVersion(major, HYPHEN, suffix);
|
||||
}
|
||||
|
||||
static SplitVersion hyphen(String[] args) {
|
||||
return version(args, HYPHEN);
|
||||
}
|
||||
|
||||
static SplitVersion dot(String[] args) {
|
||||
return version(args, DOT);
|
||||
}
|
||||
|
||||
private static SplitVersion version(String[] args, String delimiter) {
|
||||
if (args.length == 2) {
|
||||
return new SplitVersion(args[0], "", "", delimiter, args[1]);
|
||||
}
|
||||
else if (args.length == 3) {
|
||||
return new SplitVersion(args[0], args[1], "", delimiter, args[2]);
|
||||
}
|
||||
return new SplitVersion(args, delimiter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -25,11 +25,13 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
import static org.springframework.cloud.release.internal.pom.SpringCloudConstants.BOOT_DEPENDENCIES_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.pom.SpringCloudConstants.BOOT_STARTER_PARENT_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.pom.SpringCloudConstants.BUILD_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.pom.SpringCloudConstants.CLOUD_DEPENDENCIES_PARENT_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.buildsystem.SpringCloudConstants.BOOT_DEPENDENCIES_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.buildsystem.SpringCloudConstants.BOOT_STARTER_PARENT_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.buildsystem.SpringCloudConstants.BUILD_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.buildsystem.SpringCloudConstants.CLOUD_DEPENDENCIES_PARENT_ARTIFACT_ID;
|
||||
import static org.springframework.cloud.release.internal.buildsystem.SpringCloudConstants.SPRING_BOOT;
|
||||
|
||||
/**
|
||||
* Represents versions taken out from Spring Cloud Release pom.
|
||||
@@ -38,9 +40,7 @@ import static org.springframework.cloud.release.internal.pom.SpringCloudConstant
|
||||
*/
|
||||
class Versions {
|
||||
|
||||
static final Versions EMPTY_VERSION = new Versions("");
|
||||
|
||||
private static final String SPRING_BOOT_PROJECT_NAME = "spring-boot";
|
||||
static final Versions EMPTY_VERSION = new Versions();
|
||||
|
||||
String bootVersion;
|
||||
|
||||
@@ -50,9 +50,17 @@ class Versions {
|
||||
|
||||
ReleaserProperties properties;
|
||||
|
||||
private Versions() {
|
||||
this.properties = new ReleaserProperties();
|
||||
}
|
||||
|
||||
Versions(ReleaserProperties releaserProperties) {
|
||||
this.properties = releaserProperties;
|
||||
}
|
||||
|
||||
Versions(String bootVersion) {
|
||||
this.bootVersion = bootVersion;
|
||||
add(SPRING_BOOT_PROJECT_NAME, bootVersion);
|
||||
add(SPRING_BOOT, bootVersion);
|
||||
add(BOOT_STARTER_PARENT_ARTIFACT_ID, bootVersion);
|
||||
add(BOOT_DEPENDENCIES_ARTIFACT_ID, bootVersion);
|
||||
this.properties = new ReleaserProperties();
|
||||
@@ -66,6 +74,11 @@ class Versions {
|
||||
this.properties = new ReleaserProperties();
|
||||
}
|
||||
|
||||
Versions(ReleaserProperties releaserProperties, Set<Project> projects) {
|
||||
this.projects.addAll(projects);
|
||||
this.properties = releaserProperties;
|
||||
}
|
||||
|
||||
Versions(String bootVersion, String scBuildVersion, Set<Project> projects) {
|
||||
this(new ReleaserProperties(), bootVersion, scBuildVersion, projects);
|
||||
}
|
||||
@@ -75,7 +88,7 @@ class Versions {
|
||||
this.properties = properties;
|
||||
this.bootVersion = bootVersion;
|
||||
this.scBuildVersion = scBuildVersion;
|
||||
add(SPRING_BOOT_PROJECT_NAME, bootVersion);
|
||||
add(SPRING_BOOT, bootVersion);
|
||||
add(BOOT_STARTER_PARENT_ARTIFACT_ID, bootVersion);
|
||||
add(BOOT_DEPENDENCIES_ARTIFACT_ID, bootVersion);
|
||||
add(BUILD_ARTIFACT_ID, scBuildVersion);
|
||||
@@ -86,10 +99,8 @@ class Versions {
|
||||
Versions(Set<ProjectVersion> versions, ReleaserProperties properties) {
|
||||
this.properties = properties;
|
||||
this.bootVersion = versions.stream()
|
||||
.filter(projectVersion -> SPRING_BOOT_PROJECT_NAME
|
||||
.equals(projectVersion.projectName))
|
||||
.findFirst()
|
||||
.orElse(new ProjectVersion(SPRING_BOOT_PROJECT_NAME, "")).version;
|
||||
.filter(projectVersion -> SPRING_BOOT.equals(projectVersion.projectName))
|
||||
.findFirst().orElse(new ProjectVersion(SPRING_BOOT, "")).version;
|
||||
this.scBuildVersion = versions.stream().filter(
|
||||
projectVersion -> BUILD_ARTIFACT_ID.equals(projectVersion.projectName))
|
||||
.findFirst().orElse(new ProjectVersion(BUILD_ARTIFACT_ID, "")).version;
|
||||
@@ -168,7 +179,7 @@ class Versions {
|
||||
|
||||
Versions setVersion(String projectName, String version) {
|
||||
switch (projectName) {
|
||||
case SPRING_BOOT_PROJECT_NAME:
|
||||
case SPRING_BOOT:
|
||||
case BOOT_STARTER_PARENT_ARTIFACT_ID:
|
||||
case BOOT_DEPENDENCIES_ARTIFACT_ID:
|
||||
updateBootVersions(version);
|
||||
@@ -206,10 +217,10 @@ class Versions {
|
||||
|
||||
private void updateBootVersions(String version) {
|
||||
this.bootVersion = version;
|
||||
remove(SPRING_BOOT_PROJECT_NAME);
|
||||
remove(SPRING_BOOT);
|
||||
remove(BOOT_DEPENDENCIES_ARTIFACT_ID);
|
||||
remove(BOOT_STARTER_PARENT_ARTIFACT_ID);
|
||||
add(SPRING_BOOT_PROJECT_NAME, version);
|
||||
add(SPRING_BOOT, version);
|
||||
add(BOOT_STARTER_PARENT_ARTIFACT_ID, version);
|
||||
add(BOOT_DEPENDENCIES_ARTIFACT_ID, version);
|
||||
}
|
||||
@@ -221,11 +232,11 @@ class Versions {
|
||||
bomVersionProjectNames().forEach(s -> add(s, version));
|
||||
}
|
||||
|
||||
private void add(String key, String value) {
|
||||
public void add(String key, String value) {
|
||||
this.projects.add(new Project(key, value));
|
||||
}
|
||||
|
||||
private void remove(String expectedProjectName) {
|
||||
public void remove(String expectedProjectName) {
|
||||
this.projects.removeIf(project -> expectedProjectName.equals(project.name));
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ import java.io.File;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.ReleaserPropertiesAware;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.cloud.release.internal.template.TemplateGenerator;
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,12 +25,13 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.ReleaserPropertiesAware;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
// TODO: [SPRING-CLOUD]
|
||||
class ProjectDocumentationUpdater implements ReleaserPropertiesAware {
|
||||
|
||||
private static final String HTTP_SC_STATIC_URL = "http://cloud.spring.io/spring-cloud-static/";
|
||||
|
||||
@@ -32,9 +32,9 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.ReleaserPropertiesAware;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.cloud.release.internal.tech.HandlebarsHelper;
|
||||
import org.springframework.cloud.release.internal.template.TemplateGenerator;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -42,6 +42,7 @@ import org.springframework.util.StringUtils;
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
// TODO: [SPRING-CLOUD]
|
||||
class ReleaseTrainContentsUpdater implements ReleaserPropertiesAware {
|
||||
|
||||
private static final Logger log = LoggerFactory
|
||||
|
||||
@@ -21,8 +21,8 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
|
||||
@@ -27,13 +27,12 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.ReleaserPropertiesAware;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.tech.TemporaryFileStorage;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Contains business logic around Git & Github operations.
|
||||
* Contains business logic around Git operations.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@@ -51,16 +50,10 @@ public class ProjectGitHandler implements ReleaserPropertiesAware {
|
||||
|
||||
private static final String POST_RELEASE_BUMP_MSG = "Bumping versions to %s after release";
|
||||
|
||||
private final GithubMilestones githubMilestones;
|
||||
|
||||
private final GithubIssues githubIssues;
|
||||
|
||||
private ReleaserProperties properties;
|
||||
|
||||
public ProjectGitHandler(ReleaserProperties properties) {
|
||||
this.properties = properties;
|
||||
this.githubMilestones = new GithubMilestones(properties);
|
||||
this.githubIssues = new GithubIssues(properties);
|
||||
registerShutdownHook();
|
||||
}
|
||||
|
||||
@@ -267,22 +260,6 @@ public class ProjectGitHandler implements ReleaserPropertiesAware {
|
||||
gitRepo(project).pushCurrentBranch();
|
||||
}
|
||||
|
||||
public void closeMilestone(ProjectVersion releaseVersion) {
|
||||
this.githubMilestones.closeMilestone(releaseVersion);
|
||||
}
|
||||
|
||||
public void createIssueInSpringGuides(Projects projects, ProjectVersion version) {
|
||||
this.githubIssues.fileIssueInSpringGuides(projects, version);
|
||||
}
|
||||
|
||||
public void createIssueInStartSpringIo(Projects projects, ProjectVersion version) {
|
||||
this.githubIssues.fileIssueInStartSpringIo(projects, version);
|
||||
}
|
||||
|
||||
public String milestoneUrl(ProjectVersion releaseVersion) {
|
||||
return this.githubMilestones.milestoneUrl(releaseVersion);
|
||||
}
|
||||
|
||||
public String currentBranch(File project) {
|
||||
return gitRepo(project).currentBranch();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.git;
|
||||
package org.springframework.cloud.release.internal.github;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.git;
|
||||
package org.springframework.cloud.release.internal.github;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
@@ -30,8 +30,8 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.git;
|
||||
package org.springframework.cloud.release.internal.github;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
@@ -32,7 +32,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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.github;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.ReleaserPropertiesAware;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.cloud.release.internal.tech.TemporaryFileStorage;
|
||||
|
||||
/**
|
||||
* Contains business logic around Github operations.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
public class ProjectGitHubHandler implements ReleaserPropertiesAware {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProjectGitHubHandler.class);
|
||||
|
||||
private final GithubMilestones githubMilestones;
|
||||
|
||||
private final GithubIssues githubIssues;
|
||||
|
||||
private ReleaserProperties properties;
|
||||
|
||||
public ProjectGitHubHandler(ReleaserProperties properties) {
|
||||
this.properties = properties;
|
||||
this.githubMilestones = new GithubMilestones(properties);
|
||||
this.githubIssues = new GithubIssues(properties);
|
||||
registerShutdownHook();
|
||||
}
|
||||
|
||||
private void registerShutdownHook() {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(TemporaryFileStorage::cleanup));
|
||||
}
|
||||
|
||||
public void closeMilestone(ProjectVersion releaseVersion) {
|
||||
this.githubMilestones.closeMilestone(releaseVersion);
|
||||
}
|
||||
|
||||
public void createIssueInSpringGuides(Projects projects, ProjectVersion version) {
|
||||
this.githubIssues.fileIssueInSpringGuides(projects, version);
|
||||
}
|
||||
|
||||
public void createIssueInStartSpringIo(Projects projects, ProjectVersion version) {
|
||||
this.githubIssues.fileIssueInStartSpringIo(projects, version);
|
||||
}
|
||||
|
||||
public String milestoneUrl(ProjectVersion releaseVersion) {
|
||||
return this.githubMilestones.milestoneUrl(releaseVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReleaserProperties(ReleaserProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.post;
|
||||
package org.springframework.cloud.release.internal.postrelease;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
@@ -32,13 +32,13 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.buildsystem.GradleUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.gradle.GradleUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProcessedProject;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.project.ProjectBuilder;
|
||||
import org.springframework.cloud.release.internal.project.ProcessedProject;
|
||||
import org.springframework.cloud.release.internal.project.ProjectCommandExecutor;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.cloud.release.internal.versions.VersionsFetcher;
|
||||
import org.springframework.core.NestedExceptionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -58,7 +58,7 @@ public class PostReleaseActions implements Closeable {
|
||||
|
||||
private final GradleUpdater gradleUpdater;
|
||||
|
||||
private final ProjectBuilder projectBuilder;
|
||||
private final ProjectCommandExecutor projectCommandExecutor;
|
||||
|
||||
private final ReleaserProperties properties;
|
||||
|
||||
@@ -66,12 +66,12 @@ public class PostReleaseActions implements Closeable {
|
||||
|
||||
public PostReleaseActions(ProjectGitHandler projectGitHandler,
|
||||
ProjectPomUpdater projectPomUpdater, GradleUpdater gradleUpdater,
|
||||
ProjectBuilder projectBuilder, ReleaserProperties properties,
|
||||
ProjectCommandExecutor projectCommandExecutor, ReleaserProperties properties,
|
||||
VersionsFetcher versionsFetcher) {
|
||||
this.projectGitHandler = projectGitHandler;
|
||||
this.projectPomUpdater = projectPomUpdater;
|
||||
this.gradleUpdater = gradleUpdater;
|
||||
this.projectBuilder = projectBuilder;
|
||||
this.projectCommandExecutor = projectCommandExecutor;
|
||||
this.properties = properties;
|
||||
this.versionsFetcher = versionsFetcher;
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public class PostReleaseActions implements Closeable {
|
||||
Projects newProjects = addVersionForTestsProject(projects, projectVersion,
|
||||
releaseTrainVersion);
|
||||
updateWithVersions(file, newProjects);
|
||||
this.projectBuilder.build(projectVersion, file.getAbsolutePath());
|
||||
this.projectCommandExecutor.build(projectVersion, file.getAbsolutePath());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,8 +177,8 @@ public class PostReleaseActions implements Closeable {
|
||||
.map(this::getSingleResult).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
ProjectBuilder projectBuilder(ProcessedProject processedProject) {
|
||||
return new ProjectBuilder(processedProject.propertiesForProject);
|
||||
ProjectCommandExecutor projectBuilder(ProcessedProject processedProject) {
|
||||
return new ProjectCommandExecutor(processedProject.propertiesForProject);
|
||||
}
|
||||
|
||||
private Future<List<ProjectUrlAndException>> updateAllProjects(Projects projects,
|
||||
@@ -296,7 +296,7 @@ public class PostReleaseActions implements Closeable {
|
||||
Projects newProjects = addVersionForTestsProject(projects, projectVersion,
|
||||
releaseTrainVersion);
|
||||
updateWithVersions(file, newProjects);
|
||||
this.projectBuilder.generateReleaseTrainDocs(releaseTrainVersion,
|
||||
this.projectCommandExecutor.generateReleaseTrainDocs(releaseTrainVersion,
|
||||
file.getAbsolutePath());
|
||||
}
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.project;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
|
||||
/**
|
||||
* Represents a processed project.
|
||||
@@ -18,6 +18,7 @@ package org.springframework.cloud.release.internal.project;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
@@ -27,77 +28,76 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.ReleaserPropertiesAware;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
public class ProjectBuilder implements ReleaserPropertiesAware {
|
||||
public class ProjectCommandExecutor implements ReleaserPropertiesAware {
|
||||
|
||||
/**
|
||||
* Enumeration over commonly used Maven profiles.
|
||||
*/
|
||||
private enum Profile {
|
||||
|
||||
/**
|
||||
* Profile used for milestone versions.
|
||||
*/
|
||||
MILESTONE,
|
||||
|
||||
/**
|
||||
* Profile used for ga versions.
|
||||
*/
|
||||
CENTRAL,
|
||||
|
||||
/**
|
||||
* Profile used to run integration tests.
|
||||
*/
|
||||
INTEGRATION,
|
||||
|
||||
/**
|
||||
* Profile used to run guides publishing.
|
||||
*/
|
||||
GUIDES;
|
||||
|
||||
/**
|
||||
* Converts the profile to lowercase, maven command line property.
|
||||
* @return profile with prepended -P
|
||||
*/
|
||||
public String asMavenProfile() {
|
||||
return "-P" + this.name().toLowerCase();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProjectBuilder.class);
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(ProjectCommandExecutor.class);
|
||||
|
||||
private static final String VERSION_MUSTACHE = "{{version}}";
|
||||
|
||||
private ReleaserProperties properties;
|
||||
|
||||
public ProjectBuilder(ReleaserProperties properties) {
|
||||
public ProjectCommandExecutor(ReleaserProperties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
// If you want to call commands that are not parameterized via the props
|
||||
public ProjectCommandExecutor() {
|
||||
this.properties = new ReleaserProperties();
|
||||
}
|
||||
|
||||
public void build(ProjectVersion versionFromReleaseTrain) {
|
||||
build(versionFromReleaseTrain, this.properties.getWorkingDir());
|
||||
}
|
||||
|
||||
public String version() {
|
||||
return executeCommand(
|
||||
new CommandPicker(this.properties, this.properties.getWorkingDir())
|
||||
.version());
|
||||
}
|
||||
|
||||
public String groupId() {
|
||||
return executeCommand(
|
||||
new CommandPicker(this.properties, this.properties.getWorkingDir())
|
||||
.groupId());
|
||||
}
|
||||
|
||||
private String executeCommand(String command) {
|
||||
try {
|
||||
String projectRoot = this.properties.getWorkingDir();
|
||||
String[] commands = command.split(" ");
|
||||
return runCommand(projectRoot, commands);
|
||||
}
|
||||
catch (IllegalStateException e) {
|
||||
throw e;
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void build(ProjectVersion versionFromReleaseTrain, String projectRoot) {
|
||||
try {
|
||||
String[] commands = commandWithSystemProps(
|
||||
this.properties.getMaven().getBuildCommand(), versionFromReleaseTrain)
|
||||
.split(" ");
|
||||
String[] commands = new CommandPicker(this.properties, projectRoot)
|
||||
.buildCommand(versionFromReleaseTrain).split(" ");
|
||||
runCommand(projectRoot, commands);
|
||||
assertNoHtmlFilesInDocsContainUnresolvedTags(projectRoot);
|
||||
log.info("No HTML files from docs contain unresolved tags");
|
||||
@@ -109,8 +109,9 @@ public class ProjectBuilder implements ReleaserPropertiesAware {
|
||||
|
||||
public void generateReleaseTrainDocs(String version, String projectRoot) {
|
||||
try {
|
||||
String updatedCommand = this.properties.getMaven()
|
||||
.getGenerateReleaseTrainDocsCommand()
|
||||
String updatedCommand = new CommandPicker(properties, projectRoot)
|
||||
.generateReleaseTrainDocsCommand(
|
||||
new ProjectVersion(new File(projectRoot)))
|
||||
.replace(VERSION_MUSTACHE, version);
|
||||
runCommand(projectRoot, updatedCommand.split(" "));
|
||||
assertNoHtmlFilesInDocsContainUnresolvedTags(this.properties.getWorkingDir());
|
||||
@@ -121,39 +122,6 @@ public class ProjectBuilder implements ReleaserPropertiesAware {
|
||||
}
|
||||
}
|
||||
|
||||
private String commandWithSystemProps(String command, ProjectVersion version,
|
||||
Profile... profiles) {
|
||||
if (command.contains(ReleaserProperties.Maven.SYSTEM_PROPS_PLACEHOLDER)) {
|
||||
return appendProfile(command, version, profiles);
|
||||
}
|
||||
return appendProfile(command, version, profiles) + " "
|
||||
+ ReleaserProperties.Maven.SYSTEM_PROPS_PLACEHOLDER;
|
||||
}
|
||||
|
||||
private String appendProfile(String command, ProjectVersion version,
|
||||
Profile... profiles) {
|
||||
String trimmedCommand = command.trim();
|
||||
if (version.isMilestone() || version.isRc()) {
|
||||
log.info("Adding the milestone profile to the Maven build");
|
||||
return trimmedCommand + " " + Profile.MILESTONE.asMavenProfile()
|
||||
+ profilesToString(profiles);
|
||||
}
|
||||
else if (version.isRelease() || version.isServiceRelease()) {
|
||||
log.info("Adding the central profile to the Maven build");
|
||||
return trimmedCommand + " " + Profile.CENTRAL.asMavenProfile()
|
||||
+ profilesToString(profiles);
|
||||
}
|
||||
else {
|
||||
log.info("The build is a snapshot one - will not add any profiles");
|
||||
}
|
||||
return trimmedCommand;
|
||||
}
|
||||
|
||||
private String profilesToString(Profile... profiles) {
|
||||
return Arrays.stream(profiles).map(profile -> "-P" + profile)
|
||||
.collect(Collectors.joining(" "));
|
||||
}
|
||||
|
||||
private void assertNoHtmlFilesInDocsContainUnresolvedTags(String workingDir) {
|
||||
try {
|
||||
File docs = new File(workingDir, "docs");
|
||||
@@ -168,18 +136,18 @@ public class ProjectBuilder implements ReleaserPropertiesAware {
|
||||
}
|
||||
|
||||
public void deploy(ProjectVersion version) {
|
||||
doDeploy(version, this.properties.getMaven().getDeployCommand());
|
||||
doDeploy(new CommandPicker(properties, this.properties.getWorkingDir())
|
||||
.deployCommand(version));
|
||||
}
|
||||
|
||||
public void deployGuides(ProjectVersion version) {
|
||||
doDeploy(version, this.properties.getMaven().getDeployGuidesCommand(),
|
||||
Profile.GUIDES, Profile.INTEGRATION);
|
||||
doDeploy(new CommandPicker(properties, this.properties.getWorkingDir())
|
||||
.deployGuidesCommand(version));
|
||||
}
|
||||
|
||||
private void doDeploy(ProjectVersion version, String command, Profile... profiles) {
|
||||
private void doDeploy(String command) {
|
||||
try {
|
||||
String[] commands = commandWithSystemProps(command, version, profiles)
|
||||
.split(" ");
|
||||
String[] commands = command.split(" ");
|
||||
runCommand(commands);
|
||||
log.info("The project has successfully been deployed");
|
||||
}
|
||||
@@ -192,10 +160,11 @@ public class ProjectBuilder implements ReleaserPropertiesAware {
|
||||
runCommand(this.properties.getWorkingDir(), commands);
|
||||
}
|
||||
|
||||
private void runCommand(String projectRoot, String[] commands) {
|
||||
private String runCommand(String projectRoot, String[] commands) {
|
||||
String[] substitutedCommands = substituteSystemProps(commands);
|
||||
long waitTimeInMinutes = this.properties.getMaven().getWaitTimeInMinutes();
|
||||
executor(projectRoot).runCommand(substitutedCommands, waitTimeInMinutes);
|
||||
long waitTimeInMinutes = new CommandPicker(properties, projectRoot)
|
||||
.waitTimeInMinutes();
|
||||
return executor(projectRoot).runCommand(substitutedCommands, waitTimeInMinutes);
|
||||
}
|
||||
|
||||
ProcessExecutor executor(String workDir) {
|
||||
@@ -204,7 +173,7 @@ public class ProjectBuilder implements ReleaserPropertiesAware {
|
||||
|
||||
public void publishDocs(String version) {
|
||||
try {
|
||||
for (String command : this.properties.getMaven().getPublishDocsCommands()) {
|
||||
for (String command : new CommandPicker(properties).publishDocsCommands()) {
|
||||
command = command.replace(VERSION_MUSTACHE, version);
|
||||
String[] commands = command.split(" ");
|
||||
runCommand(commands);
|
||||
@@ -221,10 +190,12 @@ public class ProjectBuilder implements ReleaserPropertiesAware {
|
||||
* just pasting the String that contains these values.
|
||||
*/
|
||||
private String[] substituteSystemProps(String... commands) {
|
||||
boolean containsSystemProps = this.properties.getMaven().getSystemProperties()
|
||||
.contains("-D");
|
||||
String[] splitSystemProps = StringUtils.delimitedListToStringArray(
|
||||
this.properties.getMaven().getSystemProperties(), "-D");
|
||||
String systemProperties = new CommandPicker(this.properties).systemProperties();
|
||||
String systemPropertiesPlaceholder = new CommandPicker(this.properties)
|
||||
.systemPropertiesPlaceholder();
|
||||
boolean containsSystemProps = systemProperties.contains("-D");
|
||||
String[] splitSystemProps = StringUtils
|
||||
.delimitedListToStringArray(systemProperties, "-D");
|
||||
// first element might be empty even though the second one contains values
|
||||
if (splitSystemProps.length > 1) {
|
||||
splitSystemProps = StringUtils.isEmpty(splitSystemProps[0])
|
||||
@@ -237,7 +208,7 @@ public class ProjectBuilder implements ReleaserPropertiesAware {
|
||||
: splitSystemProps;
|
||||
final AtomicInteger index = new AtomicInteger(-1);
|
||||
for (int i = 0; i < commands.length; i++) {
|
||||
if (commands[i].contains(ReleaserProperties.Maven.SYSTEM_PROPS_PLACEHOLDER)) {
|
||||
if (commands[i].contains(systemPropertiesPlaceholder)) {
|
||||
index.set(i);
|
||||
break;
|
||||
}
|
||||
@@ -282,7 +253,7 @@ class ProcessExecutor implements ReleaserPropertiesAware {
|
||||
this.workingDir = workingDir;
|
||||
}
|
||||
|
||||
void runCommand(String[] commands, long waitTimeInMinutes) {
|
||||
String runCommand(String[] commands, long waitTimeInMinutes) {
|
||||
try {
|
||||
String workingDir = this.workingDir;
|
||||
log.info(
|
||||
@@ -302,12 +273,18 @@ class ProcessExecutor implements ReleaserPropertiesAware {
|
||||
throw new IllegalStateException("The process has exited with exit code ["
|
||||
+ process.exitValue() + "]");
|
||||
}
|
||||
return convertStreamToString(process.getInputStream());
|
||||
}
|
||||
catch (InterruptedException | IOException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private String convertStreamToString(InputStream is) {
|
||||
Scanner scanner = new Scanner(is).useDelimiter("\\A");
|
||||
return scanner.hasNext() ? scanner.next() : "";
|
||||
}
|
||||
|
||||
Process startProcess(ProcessBuilder builder) throws IOException {
|
||||
return builder.start();
|
||||
}
|
||||
@@ -323,6 +300,238 @@ class ProcessExecutor implements ReleaserPropertiesAware {
|
||||
|
||||
}
|
||||
|
||||
class CommandPicker {
|
||||
|
||||
private static final Log log = LogFactory.getLog(CommandPicker.class);
|
||||
|
||||
private enum ProjectType {
|
||||
|
||||
MAVEN, GRADLE, BASH;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Enumeration over commonly used Maven profiles.
|
||||
*/
|
||||
private enum MavenProfile {
|
||||
|
||||
/**
|
||||
* Profile used for milestone versions.
|
||||
*/
|
||||
MILESTONE,
|
||||
|
||||
/**
|
||||
* Profile used for ga versions.
|
||||
*/
|
||||
CENTRAL,
|
||||
|
||||
/**
|
||||
* Profile used to run integration tests.
|
||||
*/
|
||||
INTEGRATION,
|
||||
|
||||
/**
|
||||
* Profile used to run guides publishing.
|
||||
*/
|
||||
GUIDES;
|
||||
|
||||
/**
|
||||
* Converts the profile to lowercase, maven command line property.
|
||||
* @return profile with prepended -P
|
||||
*/
|
||||
public String asMavenProfile() {
|
||||
return "-P" + this.name().toLowerCase();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private final ReleaserProperties releaserProperties;
|
||||
|
||||
private final ProjectType projectType;
|
||||
|
||||
CommandPicker(ReleaserProperties releaserProperties, String projectRoot) {
|
||||
this.releaserProperties = releaserProperties;
|
||||
this.projectType = guessProjectType(projectRoot);
|
||||
}
|
||||
|
||||
CommandPicker(ReleaserProperties releaserProperties) {
|
||||
this.releaserProperties = releaserProperties;
|
||||
String projectRoot = releaserProperties.getWorkingDir();
|
||||
this.projectType = guessProjectType(projectRoot);
|
||||
}
|
||||
|
||||
private ProjectType guessProjectType(String projectRoot) {
|
||||
if (new File(projectRoot, "pom.xml").exists()) {
|
||||
return ProjectType.MAVEN;
|
||||
}
|
||||
else if (new File(projectRoot, "build.gradle").exists()) {
|
||||
return ProjectType.GRADLE;
|
||||
}
|
||||
return ProjectType.BASH;
|
||||
}
|
||||
|
||||
String systemProperties() {
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return releaserProperties.getGradle().getSystemProperties();
|
||||
}
|
||||
else if (projectType == ProjectType.MAVEN) {
|
||||
return releaserProperties.getMaven().getSystemProperties();
|
||||
}
|
||||
return releaserProperties.getBash().getSystemProperties();
|
||||
}
|
||||
|
||||
public String[] publishDocsCommands() {
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return releaserProperties.getGradle().getPublishDocsCommands();
|
||||
}
|
||||
else if (projectType == ProjectType.MAVEN) {
|
||||
return releaserProperties.getMaven().getPublishDocsCommands();
|
||||
}
|
||||
return releaserProperties.getBash().getPublishDocsCommands();
|
||||
}
|
||||
|
||||
String systemPropertiesPlaceholder() {
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return ReleaserProperties.Gradle.SYSTEM_PROPS_PLACEHOLDER;
|
||||
}
|
||||
else if (projectType == ProjectType.MAVEN) {
|
||||
return ReleaserProperties.Maven.SYSTEM_PROPS_PLACEHOLDER;
|
||||
}
|
||||
return ReleaserProperties.Bash.SYSTEM_PROPS_PLACEHOLDER;
|
||||
}
|
||||
|
||||
String buildCommand(ProjectVersion version) {
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return gradleCommandWithSystemProps(
|
||||
releaserProperties.getGradle().getBuildCommand());
|
||||
}
|
||||
else if (projectType == ProjectType.MAVEN) {
|
||||
return mavenCommandWithSystemProps(
|
||||
releaserProperties.getMaven().getBuildCommand(), version);
|
||||
}
|
||||
return bashCommandWithSystemProps(releaserProperties.getBash().getBuildCommand());
|
||||
}
|
||||
|
||||
String version() {
|
||||
// makes more sense to use PomReader
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return "./gradlew properties | grep version: | awk '{print $2}'";
|
||||
}
|
||||
return "./mvnw -q" + " -Dexec.executable=\"echo\""
|
||||
+ " -Dexec.args=\"\\${project.version}\"" + " --non-recursive"
|
||||
+ " org.codehaus.mojo:exec-maven-plugin:1.3.1:exec | tail -1";
|
||||
}
|
||||
|
||||
String groupId() {
|
||||
// makes more sense to use PomReader
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return "./gradlew groupId | tail -1";
|
||||
}
|
||||
return "./mvnw -q" + " -Dexec.executable=\"echo\""
|
||||
+ " -Dexec.args=\"\\${project.groupId}\"" + " --non-recursive"
|
||||
+ " org.codehaus.mojo:exec-maven-plugin:1.3.1:exec | tail -1";
|
||||
}
|
||||
|
||||
String generateReleaseTrainDocsCommand(ProjectVersion version) {
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return gradleCommandWithSystemProps(
|
||||
releaserProperties.getGradle().getGenerateReleaseTrainDocsCommand());
|
||||
}
|
||||
else if (projectType == ProjectType.MAVEN) {
|
||||
return mavenCommandWithSystemProps(
|
||||
releaserProperties.getMaven().getGenerateReleaseTrainDocsCommand(),
|
||||
version);
|
||||
}
|
||||
return bashCommandWithSystemProps(
|
||||
releaserProperties.getBash().getGenerateReleaseTrainDocsCommand());
|
||||
}
|
||||
|
||||
String deployCommand(ProjectVersion version) {
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return gradleCommandWithSystemProps(
|
||||
releaserProperties.getGradle().getDeployCommand());
|
||||
}
|
||||
else if (projectType == ProjectType.MAVEN) {
|
||||
return mavenCommandWithSystemProps(
|
||||
releaserProperties.getMaven().getDeployCommand(), version);
|
||||
}
|
||||
return bashCommandWithSystemProps(
|
||||
releaserProperties.getBash().getDeployCommand());
|
||||
}
|
||||
|
||||
String deployGuidesCommand(ProjectVersion version) {
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return gradleCommandWithSystemProps(
|
||||
releaserProperties.getGradle().getDeployGuidesCommand());
|
||||
}
|
||||
else if (projectType == ProjectType.MAVEN) {
|
||||
return mavenCommandWithSystemProps(
|
||||
releaserProperties.getMaven().getDeployGuidesCommand(), version,
|
||||
MavenProfile.GUIDES, MavenProfile.INTEGRATION);
|
||||
}
|
||||
return bashCommandWithSystemProps(
|
||||
releaserProperties.getBash().getDeployGuidesCommand());
|
||||
}
|
||||
|
||||
long waitTimeInMinutes() {
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return releaserProperties.getGradle().getWaitTimeInMinutes();
|
||||
}
|
||||
else if (projectType == ProjectType.MAVEN) {
|
||||
return releaserProperties.getMaven().getWaitTimeInMinutes();
|
||||
}
|
||||
return releaserProperties.getBash().getWaitTimeInMinutes();
|
||||
}
|
||||
|
||||
private String gradleCommandWithSystemProps(String command) {
|
||||
if (command.contains(ReleaserProperties.Gradle.SYSTEM_PROPS_PLACEHOLDER)) {
|
||||
return command;
|
||||
}
|
||||
return command + " " + ReleaserProperties.Maven.SYSTEM_PROPS_PLACEHOLDER;
|
||||
}
|
||||
|
||||
private String mavenCommandWithSystemProps(String command, ProjectVersion version,
|
||||
MavenProfile... profiles) {
|
||||
if (command.contains(ReleaserProperties.Maven.SYSTEM_PROPS_PLACEHOLDER)) {
|
||||
return appendMavenProfile(command, version, profiles);
|
||||
}
|
||||
return appendMavenProfile(command, version, profiles) + " "
|
||||
+ ReleaserProperties.Maven.SYSTEM_PROPS_PLACEHOLDER;
|
||||
}
|
||||
|
||||
private String bashCommandWithSystemProps(String command) {
|
||||
if (command.contains(ReleaserProperties.Maven.SYSTEM_PROPS_PLACEHOLDER)) {
|
||||
return command;
|
||||
}
|
||||
return command + " " + ReleaserProperties.Maven.SYSTEM_PROPS_PLACEHOLDER;
|
||||
}
|
||||
|
||||
private String appendMavenProfile(String command, ProjectVersion version,
|
||||
MavenProfile... profiles) {
|
||||
String trimmedCommand = command.trim();
|
||||
if (version.isMilestone() || version.isRc()) {
|
||||
log.info("Adding the milestone profile to the Maven build");
|
||||
return trimmedCommand + " " + MavenProfile.MILESTONE.asMavenProfile()
|
||||
+ profilesToString(profiles);
|
||||
}
|
||||
else if (version.isRelease() || version.isServiceRelease()) {
|
||||
log.info("Adding the central profile to the Maven build");
|
||||
return trimmedCommand + " " + MavenProfile.CENTRAL.asMavenProfile()
|
||||
+ profilesToString(profiles);
|
||||
}
|
||||
else {
|
||||
log.info("The build is a snapshot one - will not add any profiles");
|
||||
}
|
||||
return trimmedCommand;
|
||||
}
|
||||
|
||||
private String profilesToString(MavenProfile... profiles) {
|
||||
return Arrays.stream(profiles).map(profile -> "-P" + profile)
|
||||
.collect(Collectors.joining(" "));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class HtmlFileWalker extends SimpleFileVisitor<Path> {
|
||||
|
||||
private static final String HTML_EXTENSION = ".html";
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.project;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
@@ -26,6 +26,7 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
|
||||
/**
|
||||
* Abstraction over collection of projects.
|
||||
@@ -28,7 +28,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,8 +27,8 @@ import com.google.common.collect.ImmutableMap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.github.ProjectGitHubHandler;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
@@ -55,7 +55,7 @@ class BlogTemplateGenerator {
|
||||
private final NotesGenerator notesGenerator;
|
||||
|
||||
BlogTemplateGenerator(Template template, String releaseVersion, File blogOutput,
|
||||
Projects projects, ProjectGitHandler handler) {
|
||||
Projects projects, ProjectGitHubHandler handler) {
|
||||
this.template = template;
|
||||
this.releaseVersion = releaseVersion;
|
||||
this.blogOutput = blogOutput;
|
||||
|
||||
@@ -20,8 +20,8 @@ import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.github.ProjectGitHubHandler;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -29,9 +29,9 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
class NotesGenerator {
|
||||
|
||||
private final ProjectGitHandler handler;
|
||||
private final ProjectGitHubHandler handler;
|
||||
|
||||
NotesGenerator(ProjectGitHandler handler) {
|
||||
NotesGenerator(ProjectGitHubHandler handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,20 +25,15 @@ import java.util.Map;
|
||||
|
||||
import com.github.jknack.handlebars.Template;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.github.ProjectGitHubHandler;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
class ReleaseNotesTemplateGenerator {
|
||||
|
||||
private static final Logger log = LoggerFactory
|
||||
.getLogger(ReleaseNotesTemplateGenerator.class);
|
||||
|
||||
private final Template template;
|
||||
|
||||
private final String releaseVersion;
|
||||
@@ -50,7 +45,7 @@ class ReleaseNotesTemplateGenerator {
|
||||
private final NotesGenerator notesGenerator;
|
||||
|
||||
ReleaseNotesTemplateGenerator(Template template, String releaseVersion,
|
||||
File blogOutput, Projects projects, ProjectGitHandler handler) {
|
||||
File blogOutput, Projects projects, ProjectGitHubHandler handler) {
|
||||
this.template = template;
|
||||
this.releaseVersion = releaseVersion;
|
||||
this.blogOutput = blogOutput;
|
||||
|
||||
@@ -23,8 +23,8 @@ import com.github.jknack.handlebars.Template;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.ReleaserPropertiesAware;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.github.ProjectGitHubHandler;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.cloud.release.internal.tech.HandlebarsHelper;
|
||||
|
||||
/**
|
||||
@@ -48,11 +48,11 @@ public class TemplateGenerator implements ReleaserPropertiesAware {
|
||||
|
||||
private final File releaseNotesOutput;
|
||||
|
||||
private final ProjectGitHandler handler;
|
||||
private final ProjectGitHubHandler handler;
|
||||
|
||||
private ReleaserProperties props;
|
||||
|
||||
public TemplateGenerator(ReleaserProperties props, ProjectGitHandler handler) {
|
||||
public TemplateGenerator(ReleaserProperties props, ProjectGitHubHandler handler) {
|
||||
this.props = props;
|
||||
this.handler = handler;
|
||||
this.emailOutput = new File("target/email.txt");
|
||||
@@ -61,7 +61,8 @@ public class TemplateGenerator implements ReleaserPropertiesAware {
|
||||
this.releaseNotesOutput = new File("target/notes.md");
|
||||
}
|
||||
|
||||
TemplateGenerator(ReleaserProperties props, File output, ProjectGitHandler handler) {
|
||||
TemplateGenerator(ReleaserProperties props, File output,
|
||||
ProjectGitHubHandler handler) {
|
||||
this.props = props;
|
||||
this.emailOutput = output;
|
||||
this.blogOutput = output;
|
||||
|
||||
@@ -38,9 +38,9 @@ import org.springframework.boot.context.properties.bind.Binder;
|
||||
import org.springframework.boot.context.properties.source.MapConfigurationPropertySource;
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.ReleaserPropertiesAware;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@ import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
import org.springframework.cloud.release.internal.pom.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.pom.TestPomReader;
|
||||
import org.springframework.cloud.release.internal.pom.TestUtils;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.TestPomReader;
|
||||
import org.springframework.cloud.release.internal.buildsystem.TestUtils;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@@ -31,14 +31,15 @@ import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.cloud.release.internal.buildsystem.GradleUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.docs.DocumentationUpdater;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.gradle.GradleUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.post.PostReleaseActions;
|
||||
import org.springframework.cloud.release.internal.project.ProjectBuilder;
|
||||
import org.springframework.cloud.release.internal.github.ProjectGitHubHandler;
|
||||
import org.springframework.cloud.release.internal.postrelease.PostReleaseActions;
|
||||
import org.springframework.cloud.release.internal.project.ProjectCommandExecutor;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.cloud.release.internal.sagan.SaganUpdater;
|
||||
import org.springframework.cloud.release.internal.template.TemplateGenerator;
|
||||
|
||||
@@ -59,11 +60,14 @@ public class ReleaserTests {
|
||||
ProjectPomUpdater projectPomUpdater;
|
||||
|
||||
@Mock
|
||||
ProjectBuilder projectBuilder;
|
||||
ProjectCommandExecutor projectCommandExecutor;
|
||||
|
||||
@Mock
|
||||
ProjectGitHandler projectGitHandler;
|
||||
|
||||
@Mock
|
||||
ProjectGitHubHandler projectGitHubHandler;
|
||||
|
||||
@Mock
|
||||
TemplateGenerator templateGenerator;
|
||||
|
||||
@@ -89,9 +93,9 @@ public class ReleaserTests {
|
||||
|
||||
Releaser releaser(Supplier<ProjectVersion> originalVersionSupplier) {
|
||||
return new Releaser(new ReleaserProperties(), this.projectPomUpdater,
|
||||
this.projectBuilder, this.projectGitHandler, this.templateGenerator,
|
||||
this.gradleUpdater, this.saganUpdater, this.documentationUpdater,
|
||||
this.postReleaseActions) {
|
||||
this.projectCommandExecutor, this.projectGitHandler,
|
||||
this.projectGitHubHandler, this.templateGenerator, this.gradleUpdater,
|
||||
this.saganUpdater, this.documentationUpdater, this.postReleaseActions) {
|
||||
@Override
|
||||
ProjectVersion originalVersion(File project) {
|
||||
return originalVersionSupplier.get();
|
||||
@@ -101,9 +105,9 @@ public class ReleaserTests {
|
||||
|
||||
Releaser releaser() {
|
||||
return new Releaser(new ReleaserProperties(), this.projectPomUpdater,
|
||||
this.projectBuilder, this.projectGitHandler, this.templateGenerator,
|
||||
this.gradleUpdater, this.saganUpdater, this.documentationUpdater,
|
||||
this.postReleaseActions);
|
||||
this.projectCommandExecutor, this.projectGitHandler,
|
||||
this.projectGitHubHandler, this.templateGenerator, this.gradleUpdater,
|
||||
this.saganUpdater, this.documentationUpdater, this.postReleaseActions);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -173,7 +177,7 @@ public class ReleaserTests {
|
||||
public void should_not_close_milestone_for_snapshots() {
|
||||
releaser().closeMilestone(new ProjectVersion("original", "1.0.0.BUILD-SNAPSHOT"));
|
||||
|
||||
then(this.projectGitHandler).should(never())
|
||||
then(this.projectGitHubHandler).should(never())
|
||||
.closeMilestone(any(ProjectVersion.class));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
@@ -86,7 +86,7 @@ public class BomParserTests {
|
||||
public void should_populate_boot_version() {
|
||||
BomParser parser = new BomParser(this.properties, this.springCloudReleaseProject);
|
||||
|
||||
String bootVersion = parser.bootVersion().bootVersion;
|
||||
String bootVersion = parser.bootVersion().versionForProject("spring-boot");
|
||||
|
||||
then(bootVersion).isEqualTo("1.5.1.BUILD-SNAPSHOT");
|
||||
}
|
||||
@@ -126,7 +126,8 @@ public class BomParserTests {
|
||||
|
||||
Versions cloudVersions = parser.versionsFromBom();
|
||||
|
||||
then(cloudVersions.scBuildVersion).isEqualTo("1.3.1.BUILD-SNAPSHOT");
|
||||
then(cloudVersions.versionForProject("spring-cloud-build"))
|
||||
.isEqualTo("1.3.1.BUILD-SNAPSHOT");
|
||||
then(cloudVersions.projects).contains(allProjects());
|
||||
}
|
||||
|
||||
@@ -136,8 +137,10 @@ public class BomParserTests {
|
||||
|
||||
Versions cloudVersions = parser.allVersions();
|
||||
|
||||
then(cloudVersions.bootVersion).isEqualTo("1.5.1.BUILD-SNAPSHOT");
|
||||
then(cloudVersions.scBuildVersion).isEqualTo("1.3.1.BUILD-SNAPSHOT");
|
||||
then(cloudVersions.versionForProject("spring-boot"))
|
||||
.isEqualTo("1.5.1.BUILD-SNAPSHOT");
|
||||
then(cloudVersions.versionForProject("spring-cloud-build"))
|
||||
.isEqualTo("1.3.1.BUILD-SNAPSHOT");
|
||||
then(cloudVersions.projects).contains(allProjects());
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.EOFException;
|
||||
import java.io.File;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
@@ -26,6 +26,7 @@ import org.mockito.BDDMockito;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
@@ -25,6 +25,7 @@ import java.util.Set;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
import static org.assertj.core.api.BDDAssertions.thenThrownBy;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import org.apache.maven.plugin.logging.Log;
|
||||
import org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Properties;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.pom;
|
||||
package org.springframework.cloud.release.internal.buildsystem;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -32,7 +32,7 @@ import static org.assertj.core.api.BDDAssertions.then;
|
||||
*/
|
||||
public class VersionsTests {
|
||||
|
||||
Versions versions = new Versions("", projects());
|
||||
Versions versions = new Versions(new ReleaserProperties(), projects());
|
||||
|
||||
@Test
|
||||
public void should_add_boot_to_versions_when_version_is_created() {
|
||||
@@ -29,9 +29,9 @@ import org.junit.rules.TemporaryFolder;
|
||||
import org.mockito.BDDMockito;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.TestUtils;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.TestUtils;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@@ -23,8 +23,8 @@ import org.assertj.core.api.BDDAssertions;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
|
||||
@@ -29,11 +29,12 @@ import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.TestUtils;
|
||||
import org.springframework.cloud.release.internal.git.GitTestUtils;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.pom.TestUtils;
|
||||
import org.springframework.cloud.release.internal.github.ProjectGitHubHandler;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.cloud.release.internal.template.TemplateGenerator;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
|
||||
@@ -47,15 +48,18 @@ public class ReleaseTrainContentsUpdaterTests {
|
||||
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
|
||||
ProjectGitHandler projectGitHandler = new ProjectGitHandler(this.properties) {
|
||||
ProjectGitHubHandler projectGitHubHandler = new ProjectGitHubHandler(
|
||||
this.properties) {
|
||||
@Override
|
||||
public String milestoneUrl(ProjectVersion releaseVersion) {
|
||||
return "http://www.foo.com/";
|
||||
}
|
||||
};
|
||||
|
||||
ProjectGitHandler projectGitHandler = new ProjectGitHandler(this.properties);
|
||||
|
||||
TemplateGenerator templateGenerator = new TemplateGenerator(this.properties,
|
||||
this.projectGitHandler);
|
||||
this.projectGitHubHandler);
|
||||
|
||||
ReleaseTrainContentsUpdater updater = new ReleaseTrainContentsUpdater(this.properties,
|
||||
this.projectGitHandler, this.templateGenerator);
|
||||
|
||||
@@ -21,8 +21,8 @@ import java.util.List;
|
||||
import org.assertj.core.api.BDDAssertions;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
import org.springframework.cloud.release.internal.pom.TestUtils;
|
||||
import org.springframework.cloud.release.internal.buildsystem.TestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.fail;
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.git;
|
||||
package org.springframework.cloud.release.internal.github;
|
||||
|
||||
import com.jcabi.github.Coordinates;
|
||||
import com.jcabi.github.Github;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.git;
|
||||
package org.springframework.cloud.release.internal.github;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
@@ -33,8 +33,8 @@ import org.mockito.BDDMockito;
|
||||
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
import static org.assertj.core.api.BDDAssertions.thenThrownBy;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.git;
|
||||
package org.springframework.cloud.release.internal.github;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
@@ -30,7 +30,7 @@ import org.junit.rules.TemporaryFolder;
|
||||
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
import static org.assertj.core.api.BDDAssertions.thenThrownBy;
|
||||
@@ -29,8 +29,9 @@ import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.buildsystem.GradleUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.release.internal.post;
|
||||
package org.springframework.cloud.release.internal.postrelease;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
@@ -37,16 +37,16 @@ import org.mockito.BDDMockito;
|
||||
|
||||
import org.springframework.cloud.release.internal.PomUpdateAcceptanceTests;
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.buildsystem.GradleUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.TestPomReader;
|
||||
import org.springframework.cloud.release.internal.buildsystem.TestUtils;
|
||||
import org.springframework.cloud.release.internal.git.GitTestUtils;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.gradle.GradleUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProcessedProject;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.pom.TestPomReader;
|
||||
import org.springframework.cloud.release.internal.pom.TestUtils;
|
||||
import org.springframework.cloud.release.internal.project.ProjectBuilder;
|
||||
import org.springframework.cloud.release.internal.project.ProcessedProject;
|
||||
import org.springframework.cloud.release.internal.project.ProjectCommandExecutor;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.cloud.release.internal.versions.VersionsFetcher;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
@@ -96,7 +96,7 @@ public class PostReleaseActionsTests {
|
||||
|
||||
VersionsFetcher versionsFetcher = new VersionsFetcher(properties, updater);
|
||||
|
||||
ProjectBuilder builder = new ProjectBuilder(this.properties);
|
||||
ProjectCommandExecutor builder = new ProjectCommandExecutor(this.properties);
|
||||
|
||||
@Before
|
||||
public void setup() throws Exception {
|
||||
@@ -186,8 +186,7 @@ public class PostReleaseActionsTests {
|
||||
this.properties.getMetaRelease().setEnabled(true);
|
||||
this.properties.getGit().setReleaseTrainDocsUrl(
|
||||
tmpFile("spring-cloud-core-tests/").getAbsolutePath() + "/");
|
||||
this.properties.getMaven()
|
||||
.setGenerateReleaseTrainDocsCommand("touch generate.log");
|
||||
this.properties.getMaven().setGenerateReleaseTrainDocsCommand("./test.sh");
|
||||
PostReleaseActions actions = new PostReleaseActions(this.projectGitHandler,
|
||||
this.updater, this.gradleUpdater, this.builder, this.properties,
|
||||
versionsFetcher);
|
||||
@@ -318,15 +317,16 @@ public class PostReleaseActionsTests {
|
||||
this.properties.getMetaRelease().setGitOrgUrl(projects);
|
||||
VersionsFetcher versionsFetcher = BDDMockito.mock(VersionsFetcher.class);
|
||||
BDDMockito.given(versionsFetcher.isLatestGa(BDDMockito.any())).willReturn(true);
|
||||
AtomicReference<ProjectBuilder> projectBuilderStub = new AtomicReference<>();
|
||||
AtomicReference<ProjectCommandExecutor> projectBuilderStub = new AtomicReference<>();
|
||||
ProjectGitHandler handler = BDDMockito.mock(ProjectGitHandler.class);
|
||||
ProjectBuilder projectBuilder = BDDMockito.mock(ProjectBuilder.class);
|
||||
ProjectCommandExecutor projectCommandExecutor = BDDMockito
|
||||
.mock(ProjectCommandExecutor.class);
|
||||
PostReleaseActions actions = new PostReleaseActions(handler, this.updater,
|
||||
this.gradleUpdater, this.builder, this.properties, versionsFetcher) {
|
||||
@Override
|
||||
ProjectBuilder projectBuilder(ProcessedProject processedProject) {
|
||||
projectBuilderStub.set(projectBuilder);
|
||||
return projectBuilder;
|
||||
ProjectCommandExecutor projectBuilder(ProcessedProject processedProject) {
|
||||
projectBuilderStub.set(projectCommandExecutor);
|
||||
return projectCommandExecutor;
|
||||
}
|
||||
};
|
||||
ProjectVersion projectVersion = new ProjectVersion(
|
||||
@@ -32,8 +32,8 @@ import org.junit.rules.TemporaryFolder;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.cloud.release.internal.PomUpdateAcceptanceTests;
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.TestUtils;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.TestUtils;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
@@ -42,7 +42,7 @@ import static org.assertj.core.api.BDDAssertions.thenThrownBy;
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
public class ProjectBuilderTests {
|
||||
public class ProjectCommandExecutorTests {
|
||||
|
||||
@Rule
|
||||
public TemporaryFolder tmp = new TemporaryFolder();
|
||||
@@ -60,8 +60,8 @@ public class ProjectBuilderTests {
|
||||
FileSystemUtils.copyRecursively(file("/projects"), this.temporaryFolder);
|
||||
}
|
||||
|
||||
ProjectBuilder projectBuilder(ReleaserProperties properties) {
|
||||
return new ProjectBuilder(properties) {
|
||||
ProjectCommandExecutor projectBuilder(ReleaserProperties properties) {
|
||||
return new ProjectCommandExecutor(properties) {
|
||||
@Override
|
||||
ProcessExecutor executor(String workingDir) {
|
||||
return testExecutor(workingDir);
|
||||
@@ -73,9 +73,9 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_command_when_after_running_there_is_no_html_file_with_unresolved_tag()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("ls -al");
|
||||
properties.getBash().setBuildCommand("ls -al");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"));
|
||||
|
||||
@@ -87,9 +87,9 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_command_when_path_is_provided_explicitly()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("ls -al");
|
||||
properties.getBash().setBuildCommand("ls -al");
|
||||
properties.setWorkingDir(new File("/foo/bar").getAbsolutePath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"),
|
||||
tmpFile("/builder/resolved").getPath());
|
||||
@@ -102,66 +102,63 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_build_command_for_milestone_version()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("echo foo");
|
||||
properties.getBash().setBuildCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.M1"));
|
||||
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log")))
|
||||
.contains("foo -Pmilestone");
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log"))).contains("foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_successfully_execute_a_build_command_for_rc_version()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("echo foo");
|
||||
properties.getBash().setBuildCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.RC1"));
|
||||
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log")))
|
||||
.contains("foo -Pmilestone").doesNotContain("-Pguides");
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log"))).contains("foo")
|
||||
.doesNotContain("-Pguides");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_successfully_execute_a_build_command_for_release_version()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("echo foo");
|
||||
properties.getBash().setBuildCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.RELEASE"));
|
||||
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log")))
|
||||
.contains("foo -Pcentral");
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log"))).contains("foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_successfully_execute_a_build_command_for_sr_version()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("echo foo");
|
||||
properties.getBash().setBuildCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.SR1"));
|
||||
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log")))
|
||||
.contains("foo -Pcentral");
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log"))).contains("foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_successfully_execute_a_command_when_system_props_placeholder_is_present()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("echo {{systemProps}}");
|
||||
properties.getMaven().setSystemProperties("-Dhello=world -Dfoo=bar");
|
||||
properties.getBash().setBuildCommand("echo {{systemProps}}");
|
||||
properties.getBash().setSystemProperties("-Dhello=world -Dfoo=bar");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"));
|
||||
|
||||
@@ -173,9 +170,9 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_command_when_system_props_placeholder_is_present_and_there_are_no_sys_props()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("echo foo {{systemProps}}");
|
||||
properties.getBash().setBuildCommand("echo foo {{systemProps}}");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"));
|
||||
|
||||
@@ -186,10 +183,10 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_command_when_system_props_placeholder_is_present_without_system_props()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("echo {{systemProps}}");
|
||||
properties.getMaven().setSystemProperties("hello=world foo=bar");
|
||||
properties.getBash().setBuildCommand("echo {{systemProps}}");
|
||||
properties.getBash().setSystemProperties("hello=world foo=bar");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"));
|
||||
|
||||
@@ -201,10 +198,10 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_command_when_system_props_placeholder_is_present_inside_command()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("echo {{systemProps}} bar");
|
||||
properties.getMaven().setSystemProperties("-Dhello=world -Dfoo=bar");
|
||||
properties.getBash().setBuildCommand("echo {{systemProps}} bar");
|
||||
properties.getBash().setSystemProperties("-Dhello=world -Dfoo=bar");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"));
|
||||
|
||||
@@ -216,10 +213,10 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_pass_system_props_when_build_gets_executed_without_explicit_system_props()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("echo bar");
|
||||
properties.getMaven().setSystemProperties("-Dhello=world -Dfoo=bar");
|
||||
properties.getBash().setBuildCommand("echo bar");
|
||||
properties.getBash().setSystemProperties("-Dhello=world -Dfoo=bar");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.build(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"));
|
||||
|
||||
@@ -230,9 +227,9 @@ public class ProjectBuilderTests {
|
||||
@Test
|
||||
public void should_throw_exception_when_after_running_there_is_an_html_file_with_unresolved_tag() {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("ls -al");
|
||||
properties.getBash().setBuildCommand("ls -al");
|
||||
properties.setWorkingDir(tmpFile("/builder/unresolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
thenThrownBy(
|
||||
() -> builder.build(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT")))
|
||||
@@ -243,10 +240,10 @@ public class ProjectBuilderTests {
|
||||
@Test
|
||||
public void should_throw_exception_when_command_took_too_long_to_execute() {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("sleep 1");
|
||||
properties.getMaven().setWaitTimeInMinutes(0);
|
||||
properties.getBash().setBuildCommand("sleep 1");
|
||||
properties.getBash().setWaitTimeInMinutes(0);
|
||||
properties.setWorkingDir(tmpFile("/builder/unresolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
thenThrownBy(
|
||||
() -> builder.build(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT")))
|
||||
@@ -257,9 +254,9 @@ public class ProjectBuilderTests {
|
||||
@Test
|
||||
public void should_successfully_execute_a_deploy_command() throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setDeployCommand("ls -al");
|
||||
properties.getBash().setDeployCommand("ls -al");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.deploy(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"));
|
||||
|
||||
@@ -271,9 +268,25 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_deploy_command_for_milestone_version()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getBash().setDeployCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.deploy(new ProjectVersion("foo", "1.0.0.M1"));
|
||||
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log"))).contains("foo")
|
||||
.doesNotContain("-Pguides");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_successfully_execute_a_deploy_command_for_milestone_version_for_maven()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setDeployCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
new ProcessExecutor(properties.getWorkingDir())
|
||||
.runCommand(new String[] { "touch", "pom.xml" }, 1);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.deploy(new ProjectVersion("foo", "1.0.0.M1"));
|
||||
|
||||
@@ -285,9 +298,25 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_deploy_command_for_rc_version()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getBash().setDeployCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.deploy(new ProjectVersion("foo", "1.0.0.RC1"));
|
||||
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log"))).contains("foo")
|
||||
.doesNotContain("-Pguides");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_successfully_execute_a_deploy_command_for_rc_version_for_maven()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setDeployCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
new ProcessExecutor(properties.getWorkingDir())
|
||||
.runCommand(new String[] { "touch", "pom.xml" }, 1);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.deploy(new ProjectVersion("foo", "1.0.0.RC1"));
|
||||
|
||||
@@ -299,9 +328,24 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_deploy_command_for_release_version()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getBash().setDeployCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.deploy(new ProjectVersion("foo", "1.0.0.RELEASE"));
|
||||
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log"))).contains("foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_successfully_execute_a_deploy_command_for_release_version_for_maven()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setDeployCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
new ProcessExecutor(properties.getWorkingDir())
|
||||
.runCommand(new String[] { "touch", "pom.xml" }, 1);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.deploy(new ProjectVersion("foo", "1.0.0.RELEASE"));
|
||||
|
||||
@@ -313,24 +357,23 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_deploy_command_for_sr_version()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setDeployCommand("echo foo");
|
||||
properties.getBash().setDeployCommand("echo foo");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.deploy(new ProjectVersion("foo", "1.0.0.SR1"));
|
||||
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log")))
|
||||
.contains("foo -Pcentral");
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log"))).contains("foo");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_successfully_execute_a_deploy_command_with_sys_props_placeholder()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setDeployCommand("echo \"{{systemProps}}\"");
|
||||
properties.getMaven().setSystemProperties("-Dhello=hello-world");
|
||||
properties.getBash().setDeployCommand("echo \"{{systemProps}}\"");
|
||||
properties.getBash().setSystemProperties("-Dhello=hello-world");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.deploy(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"));
|
||||
|
||||
@@ -342,10 +385,10 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_pass_system_props_when_deploy_gets_executed_without_explicit_system_props()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setDeployCommand("echo ");
|
||||
properties.getMaven().setSystemProperties("-Dhello=hello-world");
|
||||
properties.getBash().setDeployCommand("echo ");
|
||||
properties.getBash().setSystemProperties("-Dhello=hello-world");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
builder.deploy(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"));
|
||||
|
||||
@@ -356,10 +399,10 @@ public class ProjectBuilderTests {
|
||||
@Test
|
||||
public void should_throw_exception_when_deploy_command_took_too_long_to_execute() {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setDeployCommand("sleep 1");
|
||||
properties.getMaven().setWaitTimeInMinutes(0);
|
||||
properties.getBash().setDeployCommand("sleep 1");
|
||||
properties.getBash().setWaitTimeInMinutes(0);
|
||||
properties.setWorkingDir(tmpFile("/builder/unresolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
thenThrownBy(
|
||||
() -> builder.deploy(new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT")))
|
||||
@@ -370,10 +413,10 @@ public class ProjectBuilderTests {
|
||||
@Test
|
||||
public void should_successfully_execute_a_publish_docs_command() throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setPublishDocsCommands(new String[] { "ls -al", "ls -al" });
|
||||
properties.getBash().setPublishDocsCommands(new String[] { "ls -al", "ls -al" });
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
TestProcessExecutor executor = testExecutor(properties.getWorkingDir());
|
||||
ProjectBuilder builder = new ProjectBuilder(properties) {
|
||||
ProjectCommandExecutor builder = new ProjectCommandExecutor(properties) {
|
||||
@Override
|
||||
ProcessExecutor executor(String workingDir) {
|
||||
return executor;
|
||||
@@ -391,12 +434,12 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_publish_docs_command_with_sys_props_placeholder()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setPublishDocsCommands(
|
||||
properties.getBash().setPublishDocsCommands(
|
||||
new String[] { "echo {{systemProps}} 1", "echo {{systemProps}} 2" });
|
||||
properties.getMaven().setSystemProperties("-Dhello=world -Dfoo=bar");
|
||||
properties.getBash().setSystemProperties("-Dhello=world -Dfoo=bar");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
TestProcessExecutor executor = testExecutor(properties.getWorkingDir());
|
||||
ProjectBuilder builder = new ProjectBuilder(properties) {
|
||||
ProjectCommandExecutor builder = new ProjectCommandExecutor(properties) {
|
||||
@Override
|
||||
ProcessExecutor executor(String workingDir) {
|
||||
return executor;
|
||||
@@ -414,11 +457,11 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_a_publish_docs_command_and_substitute_the_version()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven()
|
||||
properties.getBash()
|
||||
.setPublishDocsCommands(new String[] { "echo '{{version}}'" });
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
TestProcessExecutor executor = testExecutor(properties.getWorkingDir());
|
||||
ProjectBuilder builder = new ProjectBuilder(properties) {
|
||||
ProjectCommandExecutor builder = new ProjectCommandExecutor(properties) {
|
||||
@Override
|
||||
ProcessExecutor executor(String workingDir) {
|
||||
return executor;
|
||||
@@ -435,11 +478,11 @@ public class ProjectBuilderTests {
|
||||
public void should_successfully_execute_an_update_docs_command_and_substitute_the_version()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setGenerateReleaseTrainDocsCommand("echo '{{version}}'");
|
||||
properties.getBash().setGenerateReleaseTrainDocsCommand("echo '{{version}}'");
|
||||
File resolved = tmpFile("/builder/resolved");
|
||||
properties.setWorkingDir(resolved.getPath());
|
||||
TestProcessExecutor executor = testExecutor(properties.getWorkingDir());
|
||||
ProjectBuilder builder = new ProjectBuilder(properties) {
|
||||
ProjectCommandExecutor builder = new ProjectCommandExecutor(properties) {
|
||||
@Override
|
||||
ProcessExecutor executor(String workingDir) {
|
||||
return executor;
|
||||
@@ -455,11 +498,11 @@ public class ProjectBuilderTests {
|
||||
@Test
|
||||
public void should_throw_exception_when_publish_docs_command_took_too_long_to_execute() {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven()
|
||||
properties.getBash()
|
||||
.setPublishDocsCommands(new String[] { "sleep 1", "sleep 1" });
|
||||
properties.getMaven().setWaitTimeInMinutes(0);
|
||||
properties.getBash().setWaitTimeInMinutes(0);
|
||||
properties.setWorkingDir(tmpFile("/builder/unresolved").getPath());
|
||||
ProjectBuilder builder = projectBuilder(properties);
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
thenThrownBy(() -> builder.publishDocs(""))
|
||||
.hasMessageContaining("Process waiting time of [0] minutes exceeded");
|
||||
@@ -468,9 +511,9 @@ public class ProjectBuilderTests {
|
||||
@Test
|
||||
public void should_throw_exception_when_process_exits_with_invalid_code() {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getMaven().setBuildCommand("exit 1");
|
||||
properties.getBash().setBuildCommand("exit 1");
|
||||
properties.setWorkingDir(tmpFile("/builder/unresolved").getPath());
|
||||
ProjectBuilder builder = new ProjectBuilder(properties) {
|
||||
ProjectCommandExecutor builder = new ProjectCommandExecutor(properties) {
|
||||
@Override
|
||||
ProcessExecutor executor(String workingDir) {
|
||||
return new ProcessExecutor(properties.getWorkingDir()) {
|
||||
@@ -31,7 +31,7 @@ import org.mockito.BDDMockito;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
|
||||
@@ -24,9 +24,9 @@ import java.util.HashSet;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.github.ProjectGitHubHandler;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
|
||||
import static org.assertj.core.api.BDDAssertions.then;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class TemplateGeneratorTests {
|
||||
|
||||
ReleaserProperties props = new ReleaserProperties();
|
||||
|
||||
ProjectGitHandler handler = new ProjectGitHandler(this.props) {
|
||||
ProjectGitHubHandler handler = new ProjectGitHubHandler(this.props) {
|
||||
@Override
|
||||
public String milestoneUrl(ProjectVersion releaseVersion) {
|
||||
if (releaseVersion.projectName.equals("spring-cloud-foo")) {
|
||||
@@ -303,7 +303,7 @@ public class TemplateGeneratorTests {
|
||||
@Test
|
||||
public void should_generate_release_notes_template_when_url_exists()
|
||||
throws IOException {
|
||||
ProjectGitHandler handler = new ProjectGitHandler(this.props) {
|
||||
ProjectGitHubHandler handler = new ProjectGitHubHandler(this.props) {
|
||||
@Override
|
||||
public String milestoneUrl(ProjectVersion releaseVersion) {
|
||||
return "https://foo.bar.com?closed=1";
|
||||
|
||||
@@ -27,10 +27,10 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.pom.Projects;
|
||||
import org.springframework.cloud.release.internal.pom.TestUtils;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.buildsystem.ProjectVersion;
|
||||
import org.springframework.cloud.release.internal.buildsystem.TestUtils;
|
||||
import org.springframework.cloud.release.internal.project.Projects;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
|
||||
class VersionsFetcherTests {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Added script
|
||||
Binary file not shown.
@@ -1 +1,2 @@
|
||||
0000000000000000000000000000000000000000 6b833ad3b334f1ccf60e0bd27ff5781e618e79aa Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1540290537 +0200 clone: from git@github.com:spring-cloud/spring-cloud-core-tests.git
|
||||
6b833ad3b334f1ccf60e0bd27ff5781e618e79aa aeef09d318e80a96a54332a3eccfa72d6cc56689 Marcin Grzejszczak <marcin@grzejszczak.pl> 1566838500 +0200 commit: Added script
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
0000000000000000000000000000000000000000 6b833ad3b334f1ccf60e0bd27ff5781e618e79aa Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1540290537 +0200 clone: from git@github.com:spring-cloud/spring-cloud-core-tests.git
|
||||
6b833ad3b334f1ccf60e0bd27ff5781e618e79aa aeef09d318e80a96a54332a3eccfa72d6cc56689 Marcin Grzejszczak <marcin@grzejszczak.pl> 1566838500 +0200 commit: Added script
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
xmSAn<41>0<10><>|<7C>§$ph'-
|
||||
<EFBFBD><EFBFBD>Xq\Th`<03>S#GJZ<4A><5A>ȤJRQ<52> <>RV۸<56><0E><><EFBFBD><19><>RieR<65><52>\~|7>p3S<33>-<2D>[<0F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>~<7E>`<60>HZU<5A><1A>5<EFBFBD><35><EFBFBD><EFBFBD><EFBFBD><0B>[<5B>P;̡<>9<EFBFBD><14>*cl<63>3<EFBFBD><33>h
|
||||
<EFBFBD>r'<27>u<EFBFBD>o
|
||||
O<EFBFBD><02><>4<EFBFBD>S{<7B><>C<EFBFBD><43>9<EFBFBD>AA>eX{
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
x<01>U<EFBFBD>n1<10>5<EFBFBD><35>!B$v<>R$.ڦjI<6A>"<22><>J<EFBFBD>O<><4F>;I,ym<79><6D>&<26>|;c<>%!MQ<4D>x<EFBFBD><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>93G<33><47>PS8|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><10>Dc<44><63><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ePf*<2A>r~ܽ<><DCBD>1z<31>=<3D><1D><16><><EFBFBD><EFBFBD>t(6<><36><EFBFBD>&<26>a'<27>yϠV<CFA0>ՆJc<4A>҄Rᨤ<1E>
|
||||
<EFBFBD>=<3D><>r^<5E><07><>.<2E>^_M<06><><EFBFBD><EFBFBD><EFBFBD>{<7B><>5<EFBFBD>C3kW<6B><57><EFBFBD>:.O'<27>/<17>>u<>5<EFBFBD>IR<49><52><04>0<EFBFBD><30>F<46><CDB8>m<EFBFBD>QqzE<><45><EFBFBD>y|<16>[p<0B>1P<31><50>X<EFBFBD>
|
||||
<EFBFBD>S`K<><4B>q<EFBFBD>Z`2<>a`<60><>9<EFBFBD>H<15>`Ė(<28>(><3E><03><><11>|<7C>@"<22><>$u d<>(<<3C><><12><>`<60>J<1C>V<EFBFBD>i<EFBFBD>lf<6C>v<EFBFBD><76>X<EFBFBD><58>sPf<50>.@3<><33><EFBFBD>%<25>W<EFBFBD><57>[<5B>~<7E><><0B>l3<6C>A&<26>&芷]<5D>R<EFBFBD><52><15>ΓGn<47>~<7E><14><><EFBFBD>Ԁf<>,<1C><>^x<0E><><EFBFBD>pK;&I<><49>p~$q<><71><EFBFBD>^<5E>$&O<>DQ<44><51><EFBFBD>G<><47><04>%CI'
|
||||
<[<5B>q<EFBFBD>J<EFBFBD>zΔ<7A>&<26>YO<59><4F>n<EFBFBD>So;˝2<CB9D>Z4մ<34>u<EFBFBD><1F>Y<EFBFBD><59><EFBFBD>d<EFBFBD><64><EFBFBD>lK<6C><1A>='<27><>0<EFBFBD><14>tK'-<2D><>-<2D><><EFBFBD>}<7D><><EFBFBD><EFBFBD>D<EFBFBD><44>mq#<23>2&<26><>T_<54><5F>W։N<D689><4E>M<05><><EFBFBD><EFBFBD><EFBFBD>.Ov<4F><76>p_<70>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD>;<3B>)<29>w*mU<Db<44><62> <20>3&,-<2D><><EFBFBD>4(<28>ٻ%<25><><EFBFBD>{
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
xmR<6D>r<EFBFBD>0<10>5<EFBFBD><35>NI<4E><49>$ͥ<><07><>ӌ<EFBFBD><D38C><EFBFBD>L<EFBFBD><4C><EFBFBD>5Fr<46>u<0C>ɿwe<77>64<36><34>X<EFBFBD>}O<><4F>ݬ<EFBFBD>\]^<5E>|<18>8<><38><EFBFBD><EFBFBD>N<EFBFBD><1B><>˫<EFBFBD><17><> h<>`<60><><EFBFBD><EFBFBD>@5<><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><0B>{<7B><><EFBFBD>X@c
|
||||
t(<28>U<EFBFBD><55><EFBFBD>f<08><>ym
|
||||
\<5C>K8
|
||||
<EFBFBD><EFBFBD><EFBFBD>jpv(<28><><EFBFBD><EFBFBD>ڃ<EFBFBD><04>G<EFBFBD><47>ֺB<D6BA>]<5D>5<EFBFBD>6<EFBFBD><36>m]ier<65>VӦ{<7B>g J<><4A><EFBFBD><EFBFBD>)nW<0C><>`<60>oAQ/<1A>oCT<43>ϣQ۶Ru<52><75>u<EFBFBD><75>:<18><><EFBFBD>x2K<32><4B><05><>a<0F>B<EFBFBD><42><EFBFBD><EFBFBD>F;<3B><><EFBFBD>A<EFBFBD>,+W<19><>T<EFBFBD><54>S:<3A>;<3B>Av<41>4iS<0E><>5<EFBFBD><35>a<EFBFBD>ZhONg
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
x<01>T]o<>0<14><><EFBFBD>W}<7D>P<EFBFBD><50>!&A_<41>u<EFBFBD><75>-j<>DŽxp<78><70><EFBFBD>Zj<07>!<21><><EFBFBD>;<3B>N<18>i<EFBFBD><69>m}<7D>{|<7C>9<EFBFBD>:-u
|
||||
ONNNMG<><18><><EFBFBD>Yl=yzH_<48><5F>m4<05><>%<25><>m<EFBFBD><6D>u<EFBFBD><75>2J<32><4A><EFBFBD>R<EFBFBD><52><EFBFBD>A<EFBFBD>24!iVqA<71><41><EFBFBD>ޡ<>R+8fG0<47><30><EFBFBD>nkx0<78>{]Î<>Ai<07>ErY"<22><><EFBFBD>ʁT <20><>*%W<02><>n<1B><>P<<13><>0t<30>8<1D><>P<EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD>]G<1A>g<EFBFBD>\e_L&M<>0(3m<33>I<EFBFBD>d'<27><>|<7C>L<16>D<EFBFBD>K{<7B>J<EFBFBD>~<7E><><EFBFBD><EFBFBD><EFBFBD>=<3D><>h <09>ْ7A<37><41> <20>9<EFBFBD>i7F:<3A><>1X<31><58><EFBFBD><1B>\3i<33><69>i<EFBFBD>~R<><52><06><><EFBFBD>ҍ+<18><12><>!<21>͒8{<7B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><06><><EFBFBD><EFBFBD><EFBFBD>r/X<>a<EFBFBD>Z<EFBFBD>Ǜx<C79B><78><EFBFBD>̖W<CC96>*^<5E><>I3ro*<2A>+ <1B><><13> ^<5E>^<5E>;<3B> <20>}<7D><>
|
||||
<EFBFBD>KA<EFBFBD><EFBFBD><EFBFBD><EFBFBD>B<><42><EFBFBD>QTThv<68>z_-<11><<3C>R<EFBFBD><52><EFBFBD>.<2E>~tCϥI<14><><EFBFBD>(Ý<>F<11><><EFBFBD><11><><EFBFBD><EFBFBD>nn<6E>m<>Y<EFBFBD><59>cI<08>Z<EFBFBD>=<3D><><EFBFBD>)ԩZh<5A>ˢ6<CBA2><01>֟<><D69F>R<EFBFBD>S<><53>R<EFBFBD>0<EFBFBD>)Պ<><D58A>ϜSnM&^<5E><><EFBFBD>[5پg<D9BE><0F>1!<21><>f~<7E>B̵rx<72>Hk<48>n<EFBFBD><6E>"w<><77><EFBFBD><EFBFBD>tmv<><76><18>PPWt<><74>#
|
||||
Si<EFBFBD>=<3D>ϸ<EFBFBD><CFB8><0E><>L<>wO<77><4F>B<EFBFBD><42><EFBFBD>kB<6B>p<EFBFBD><70><EFBFBD><EFBFBD>[<5B>i_<69><5F>0<EFBFBD>zx<7A>=8<><0F><><17><><EFBFBD><0B><><EFBFBD>_zs<7A><73>:<3A><><<3C>X<EFBFBD>]j<><6A>QT<51>)M1<4D><31><EFBFBD>p<EFBFBD>o<EFBFBD>5
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
x=<3D>K<0E>0DY<44><14>ABPe<50><04><04>a<EFBFBD><61>.D<>8ʧNOڴ<4F>&<26><><EFBFBD><EFBFBD>eia<69>lW<6C>yc<79><63>@<40><>h<EFBFBD>F<EFBFBD><46><04><>"ߔ<>(<28>7<EFBFBD><37> Z<06><><0B><> ͒<><CD92><EFBFBD> ( <05><><<3C>)<0B>ao<><6F><EFBFBD><EFBFBD>yУ<79>3<EFBFBD><33> <20>D<EFBFBD>g<EFBFBD><67>Z2<01>b˔<62>VQ<56><51><EFBFBD>q<EFBFBD>ِ<EFBFBD><05><><06><><EFBFBD>y1v<31>c<EFBFBD>x<13><>y<EFBFBD>肪뱗RK<52><03>F~H<><48><EFBFBD>w<EFBFBD><77>D<EFBFBD><44>p<>\
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user