Adds commercial suffix when cloning projects for commercial releases
This commit is contained in:
@@ -78,6 +78,8 @@ public class ReleaserProperties implements Serializable {
|
|||||||
|
|
||||||
private Versions versions = new Versions();
|
private Versions versions = new Versions();
|
||||||
|
|
||||||
|
private boolean commercial = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project name to its version - overrides all versions retrieved from a release train
|
* Project name to its version - overrides all versions retrieved from a release train
|
||||||
* repository like Spring Cloud Release.
|
* repository like Spring Cloud Release.
|
||||||
@@ -198,12 +200,20 @@ public class ReleaserProperties implements Serializable {
|
|||||||
this.versions = versions;
|
this.versions = versions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCommercial() {
|
||||||
|
return commercial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommercial(boolean commercial) {
|
||||||
|
this.commercial = commercial;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ReleaserProperties{" + "workingDir='" + this.workingDir + '\'' + ", git=" + this.git + ", pom="
|
return "ReleaserProperties{" + "workingDir='" + this.workingDir + '\'' + ", git=" + this.git + ", pom="
|
||||||
+ this.pom + ", maven=" + this.maven + ", gradle=" + this.gradle + ", sagan=" + this.sagan
|
+ this.pom + ", maven=" + this.maven + ", gradle=" + this.gradle + ", sagan=" + this.sagan
|
||||||
+ ", fixedVersions=" + this.fixedVersions + ", metaRelease=" + this.metaRelease + ", template="
|
+ ", fixedVersions=" + this.fixedVersions + ", metaRelease=" + this.metaRelease + ", template="
|
||||||
+ this.template + ", versions=" + this.versions + '}';
|
+ this.template + ", versions=" + this.versions + ", commercial=" + this.commercial + '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReleaserProperties copy() {
|
public ReleaserProperties copy() {
|
||||||
|
|||||||
@@ -136,6 +136,10 @@ public class ProjectGitHandler implements Closeable {
|
|||||||
return clonedProject;
|
return clonedProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String addCommercialSuffix(String projectName) {
|
||||||
|
return this.properties.isCommercial() ? projectName + "-commercial" : projectName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For meta-release. Works with fixed versions only
|
* For meta-release. Works with fixed versions only
|
||||||
* @param projectName - name of the project to clone
|
* @param projectName - name of the project to clone
|
||||||
@@ -144,7 +148,7 @@ public class ProjectGitHandler implements Closeable {
|
|||||||
public File cloneProjectFromOrg(String projectName) {
|
public File cloneProjectFromOrg(String projectName) {
|
||||||
String orgUrl = this.properties.getMetaRelease().getGitOrgUrl();
|
String orgUrl = this.properties.getMetaRelease().getGitOrgUrl();
|
||||||
String fullUrl = orgUrl.endsWith("/") ? (orgUrl + projectName)
|
String fullUrl = orgUrl.endsWith("/") ? (orgUrl + projectName)
|
||||||
: (orgUrl + "/" + projectName + suffixNonHttpRepo(orgUrl));
|
: (orgUrl + "/" + addCommercialSuffix(projectName) + suffixNonHttpRepo(orgUrl));
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("Full url of the project is [{}]", fullUrl);
|
log.debug("Full url of the project is [{}]", fullUrl);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user