GH-195 Fix profile for publish/deploying docs

This change included changing the command name from plural to signular publish-docs-command(s)

Resolves #195
This commit is contained in:
Oleg Zhurakousky
2020-07-17 17:34:40 +02:00
parent 922c939153
commit 43cf760ec0
9 changed files with 92 additions and 65 deletions

View File

@@ -5,7 +5,7 @@
|releaser.bash.deploy-command | echo "{{systemProps}}" | Command to be executed to deploy a built project. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. |releaser.bash.deploy-command | echo "{{systemProps}}" | Command to be executed to deploy a built project. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating.
|releaser.bash.deploy-guides-command | echo "{{systemProps}}" | Command to be executed to build and deploy guides project only. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. |releaser.bash.deploy-guides-command | echo "{{systemProps}}" | Command to be executed to build and deploy guides project only. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating.
|releaser.bash.generate-release-train-docs-command | echo "{{version}}" | Command to be executed to generate release train documentation. |releaser.bash.generate-release-train-docs-command | echo "{{version}}" | Command to be executed to generate release train documentation.
|releaser.bash.publish-docs-commands | [mkdir -p target, echo "{{version}}"] | Command to be executed to publish documentation. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. |releaser.bash.publish-docs-command | [mkdir -p target, echo "{{version}}"] | Command to be executed to publish documentation. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating.
|releaser.bash.system-properties | | Additional system properties that should be passed to the build / deploy commands. If present in other commands "{{systemProps}}" will be substituted with this property. |releaser.bash.system-properties | | Additional system properties that should be passed to the build / deploy commands. If present in other commands "{{systemProps}}" will be substituted with this property.
|releaser.bash.wait-time-in-minutes | 20 | Max wait time in minutes for the process to finish. |releaser.bash.wait-time-in-minutes | 20 | Max wait time in minutes for the process to finish.
|releaser.fixed-versions | | Project name to its version - overrides all versions retrieved from a release train repository like Spring Cloud Release. |releaser.fixed-versions | | Project name to its version - overrides all versions retrieved from a release train repository like Spring Cloud Release.
@@ -43,14 +43,14 @@
|releaser.gradle.generate-release-train-docs-command | ./gradlew generateReleaseTrainDocs --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}} | Command to be executed to generate release train documentation. |releaser.gradle.generate-release-train-docs-command | ./gradlew generateReleaseTrainDocs --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}} | Command to be executed to generate release train documentation.
|releaser.gradle.gradle-props-substitution | | A mapping that should be applied to {@code gradle.properties} in order to perform a substitution of properties. The mapping is from a property inside {@code gradle.properties} to the projects name. Example. In {@code gradle.properties} you have {@code verifierVersion=1.0.0} . You want this property to get updated with the value of {@code spring-cloud-contract} version. Then it's enough to do the mapping like this for this Releaser's property: {@code verifierVersion=spring-cloud-contract}. |releaser.gradle.gradle-props-substitution | | A mapping that should be applied to {@code gradle.properties} in order to perform a substitution of properties. The mapping is from a property inside {@code gradle.properties} to the projects name. Example. In {@code gradle.properties} you have {@code verifierVersion=1.0.0} . You want this property to get updated with the value of {@code spring-cloud-contract} version. Then it's enough to do the mapping like this for this Releaser's property: {@code verifierVersion=spring-cloud-contract}.
|releaser.gradle.ignored-gradle-regex | | List of regular expressions of ignored gradle props. Defaults to test projects and samples. |releaser.gradle.ignored-gradle-regex | | List of regular expressions of ignored gradle props. Defaults to test projects and samples.
|releaser.gradle.publish-docs-commands | [./gradlew publishDocs --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}] | Command to be executed to publish documentation. If present "{{version}}" will be replaced by the provided version. |releaser.gradle.publish-docs-command | [./gradlew publishDocs --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}] | Command to be executed to publish documentation. If present "{{version}}" will be replaced by the provided version.
|releaser.gradle.system-properties | | Additional system properties that should be passed to the build / deploy commands. If present in other commands "{{systemProps}}" will be substituted with this property. |releaser.gradle.system-properties | | Additional system properties that should be passed to the build / deploy commands. If present in other commands "{{systemProps}}" will be substituted with this property.
|releaser.gradle.wait-time-in-minutes | 20 | Max wait time in minutes for the process to finish. |releaser.gradle.wait-time-in-minutes | 20 | Max wait time in minutes for the process to finish.
|releaser.maven.build-command | ./mvnw clean install -B -Pdocs {{systemProps}} | Command to be executed to build the project. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. |releaser.maven.build-command | ./mvnw clean install -B -Pdocs {{systemProps}} | Command to be executed to build the project. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating.
|releaser.maven.deploy-command | ./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}} | Command to be executed to deploy a built project. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. |releaser.maven.deploy-command | ./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}} | Command to be executed to deploy a built project. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating.
|releaser.maven.deploy-guides-command | ./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}} | Command to be executed to build and deploy guides project only. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating. |releaser.maven.deploy-guides-command | ./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}} | Command to be executed to build and deploy guides project only. If present "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot version and "{{oldVersion}}" with the version before version updating.
|releaser.maven.generate-release-train-docs-command | bash release_train.sh --retrieveversions --version {{version}} --ghpages --auto | Command to be executed to generate release train documentation. |releaser.maven.generate-release-train-docs-command | bash release_train.sh --retrieveversions --version {{version}} --ghpages --auto | Command to be executed to generate release train documentation.
|releaser.maven.publish-docs-commands | [mkdir -p target, wget https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/ghpages.sh -O target/gh-pages.sh, chmod +x target/gh-pages.sh, ./target/gh-pages.sh -v {{version}} -c] | Command to be executed to publish documentation. If present "{{version}}" will be replaced by the provided version. |releaser.maven.publish-docs-command | [mkdir -p target, wget https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/ghpages.sh -O target/gh-pages.sh, chmod +x target/gh-pages.sh, ./target/gh-pages.sh -v {{version}} -c] | Command to be executed to publish documentation. If present "{{version}}" will be replaced by the provided version.
|releaser.maven.system-properties | | Additional system properties that should be passed to the build / deploy commands. If present in other commands "{{systemProps}}" will be substituted with this property. |releaser.maven.system-properties | | Additional system properties that should be passed to the build / deploy commands. If present in other commands "{{systemProps}}" will be substituted with this property.
|releaser.maven.wait-time-in-minutes | 20 | Max wait time in minutes for the process to finish. |releaser.maven.wait-time-in-minutes | 20 | Max wait time in minutes for the process to finish.
|releaser.meta-release.enabled | false | Are we releasing the whole suite of apps or only one? |releaser.meta-release.enabled | false | Are we releasing the whole suite of apps or only one?

View File

@@ -24,8 +24,7 @@ releaser:
build-command: "./mvnw clean install -B -Pdocs {{systemProps}}" build-command: "./mvnw clean install -B -Pdocs {{systemProps}}"
deploy-command: "./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}}" deploy-command: "./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}}"
deploy-guides-command: "./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}}" deploy-guides-command: "./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}}"
publish-docs-commands: publish-docs-command: "./mvnw deploy -DskipTests -B -Pfast,deploy,docs {{systemProps}}"
- "./mvnw deploy -DskipTests -B -Pfast,deploy,docs {{systemProps}}"
generate-release-train-docs-command: "bash release_train.sh --retrieveversions --version {{version}} --ghpages --auto" generate-release-train-docs-command: "bash release_train.sh --retrieveversions --version {{version}} --ghpages --auto"
sagan: sagan:
update-sagan: true update-sagan: true

View File

@@ -63,8 +63,7 @@ releaser:
build-command: "./mvnw clean install -B -Pdocs {{systemProps}}" build-command: "./mvnw clean install -B -Pdocs {{systemProps}}"
deploy-command: "./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}}" deploy-command: "./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}}"
deploy-guides-command: "./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}}" deploy-guides-command: "./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}}"
publish-docs-commands: publish-docs-command: "./mvnw deploy -DskipTests -B -Pfast,deploy,docs -pl docs {{systemProps}}"
- "./mvnw deploy -DskipTests -B -Pfast,deploy,docs -pl docs {{systemProps}}"
generate-release-train-docs-command: "./mvnw clean deploy -Pdocs,train-docs -pl train-docs" generate-release-train-docs-command: "./mvnw clean deploy -Pdocs,train-docs -pl train-docs"
system-properties: "" system-properties: ""
wait-time-in-minutes: 20 wait-time-in-minutes: 20
@@ -72,8 +71,7 @@ releaser:
build-command: 'echo "{{systemProps}}"' build-command: 'echo "{{systemProps}}"'
deploy-command: 'echo "{{systemProps}}"' deploy-command: 'echo "{{systemProps}}"'
deploy-guides-command: 'echo "{{systemProps}}"' deploy-guides-command: 'echo "{{systemProps}}"'
publish-docs-commands: publish-docs-command: 'echo "{{systemProps}}"'
- 'echo "{{systemProps}}"'
generate-release-train-docs-command: 'echo "{{systemProps}}"' generate-release-train-docs-command: 'echo "{{systemProps}}"'
system-properties: "" system-properties: ""
wait-time-in-minutes: 20 wait-time-in-minutes: 20
@@ -92,8 +90,7 @@ releaser:
build-command: "./gradlew clean build publishToMavenLocal --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}" build-command: "./gradlew clean build publishToMavenLocal --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}"
deploy-command: "./gradlew publish --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}" deploy-command: "./gradlew publish --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}"
deploy-guides-command: "./gradlew clean build deployGuides --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}" deploy-guides-command: "./gradlew clean build deployGuides --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}"
publish-docs-commands: publish-docs-command: "echo 'TODO'"
- "echo 'TODO'"
generate-release-train-docs-command: "echo 'TODO'" generate-release-train-docs-command: "echo 'TODO'"
system-properties: "" system-properties: ""
wait-time-in-minutes: 20 wait-time-in-minutes: 20

View File

@@ -18,7 +18,6 @@ package releaser.internal;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
@@ -251,12 +250,12 @@ public class ReleaserProperties implements Serializable {
/** /**
* @return docs publishing commands * @return docs publishing commands
*/ */
String[] getPublishDocsCommands(); String getPublishDocsCommand();
/** /**
* @param publishDocsCommands to set * @param publishDocsCommands to set
*/ */
void setPublishDocsCommands(String[] publishDocsCommands); void setPublishDocsCommand(String publishDocsCommands);
/** /**
* @return generate release train docs command * @return generate release train docs command
@@ -966,8 +965,7 @@ public class ReleaserProperties implements Serializable {
* Command to be executed to publish documentation. If present "{{version}}" will * Command to be executed to publish documentation. If present "{{version}}" will
* be replaced by the provided version. * be replaced by the provided version.
*/ */
private String[] publishDocsCommands = { private String publishDocsCommand = "./mvnw deploy -DskipTests -B -Pfast,deploy,docs -pl docs {{systemProps}}";
"./mvnw deploy -DskipTests -B -Pfast,deploy,docs -pl docs {{systemProps}}" };
/** /**
* Command to be executed to generate release train documentation. * Command to be executed to generate release train documentation.
@@ -987,10 +985,12 @@ public class ReleaserProperties implements Serializable {
*/ */
private long waitTimeInMinutes = 20; private long waitTimeInMinutes = 20;
@Override
public String getBuildCommand() { public String getBuildCommand() {
return this.buildCommand; return this.buildCommand;
} }
@Override
public void setBuildCommand(String buildCommand) { public void setBuildCommand(String buildCommand) {
this.buildCommand = buildCommand; this.buildCommand = buildCommand;
} }
@@ -1003,43 +1003,53 @@ public class ReleaserProperties implements Serializable {
this.waitTimeInMinutes = waitTimeInMinutes; this.waitTimeInMinutes = waitTimeInMinutes;
} }
@Override
public String getDeployCommand() { public String getDeployCommand() {
return this.deployCommand; return this.deployCommand;
} }
@Override
public void setDeployCommand(String deployCommand) { public void setDeployCommand(String deployCommand) {
this.deployCommand = deployCommand; this.deployCommand = deployCommand;
} }
@Override
public String getDeployGuidesCommand() { public String getDeployGuidesCommand() {
return this.deployGuidesCommand; return this.deployGuidesCommand;
} }
@Override
public void setDeployGuidesCommand(String deployGuidesCommand) { public void setDeployGuidesCommand(String deployGuidesCommand) {
this.deployGuidesCommand = deployGuidesCommand; this.deployGuidesCommand = deployGuidesCommand;
} }
public String[] getPublishDocsCommands() { @Override
return this.publishDocsCommands; public String getPublishDocsCommand() {
return this.publishDocsCommand;
} }
public void setPublishDocsCommands(String[] publishDocsCommands) { @Override
this.publishDocsCommands = publishDocsCommands; public void setPublishDocsCommand(String publishDocsCommand) {
this.publishDocsCommand = publishDocsCommand;
} }
@Override
public String getGenerateReleaseTrainDocsCommand() { public String getGenerateReleaseTrainDocsCommand() {
return this.generateReleaseTrainDocsCommand; return this.generateReleaseTrainDocsCommand;
} }
@Override
public void setGenerateReleaseTrainDocsCommand( public void setGenerateReleaseTrainDocsCommand(
String generateReleaseTrainDocsCommand) { String generateReleaseTrainDocsCommand) {
this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand; this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand;
} }
@Override
public String getSystemProperties() { public String getSystemProperties() {
return this.systemProperties; return this.systemProperties;
} }
@Override
public void setSystemProperties(String systemProperties) { public void setSystemProperties(String systemProperties) {
this.systemProperties = systemProperties; this.systemProperties = systemProperties;
} }
@@ -1048,7 +1058,7 @@ public class ReleaserProperties implements Serializable {
public String toString() { public String toString() {
return "Maven{" + "buildCommand='" + this.buildCommand + '\'' return "Maven{" + "buildCommand='" + this.buildCommand + '\''
+ ", deployCommand='" + this.deployCommand + '\'' + ", deployCommand='" + this.deployCommand + '\''
+ ", publishDocsCommands=" + Arrays.toString(this.publishDocsCommands) + ", publishDocsCommand=" + this.publishDocsCommand
+ "generateReleaseTrainDocsCommand='" + "generateReleaseTrainDocsCommand='"
+ this.generateReleaseTrainDocsCommand + '\'' + ", waitTimeInMinutes=" + this.generateReleaseTrainDocsCommand + '\'' + ", waitTimeInMinutes="
+ this.waitTimeInMinutes + '}'; + this.waitTimeInMinutes + '}';
@@ -1090,8 +1100,7 @@ public class ReleaserProperties implements Serializable {
* be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot * be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot
* version and "{{oldVersion}}" with the version before version updating. * version and "{{oldVersion}}" with the version before version updating.
*/ */
private String[] publishDocsCommands = { "mkdir -p target", private String publishDocsCommand = "mkdir -p target && echo \"{{version}}\"";
"echo \"{{version}}\"" };
/** /**
* Command to be executed to generate release train documentation. * Command to be executed to generate release train documentation.
@@ -1110,10 +1119,12 @@ public class ReleaserProperties implements Serializable {
*/ */
private long waitTimeInMinutes = 20; private long waitTimeInMinutes = 20;
@Override
public String getBuildCommand() { public String getBuildCommand() {
return this.buildCommand; return this.buildCommand;
} }
@Override
public void setBuildCommand(String buildCommand) { public void setBuildCommand(String buildCommand) {
this.buildCommand = buildCommand; this.buildCommand = buildCommand;
} }
@@ -1126,43 +1137,53 @@ public class ReleaserProperties implements Serializable {
this.waitTimeInMinutes = waitTimeInMinutes; this.waitTimeInMinutes = waitTimeInMinutes;
} }
@Override
public String getDeployCommand() { public String getDeployCommand() {
return this.deployCommand; return this.deployCommand;
} }
@Override
public void setDeployCommand(String deployCommand) { public void setDeployCommand(String deployCommand) {
this.deployCommand = deployCommand; this.deployCommand = deployCommand;
} }
@Override
public String getDeployGuidesCommand() { public String getDeployGuidesCommand() {
return this.deployGuidesCommand; return this.deployGuidesCommand;
} }
@Override
public void setDeployGuidesCommand(String deployGuidesCommand) { public void setDeployGuidesCommand(String deployGuidesCommand) {
this.deployGuidesCommand = deployGuidesCommand; this.deployGuidesCommand = deployGuidesCommand;
} }
public String[] getPublishDocsCommands() { @Override
return this.publishDocsCommands; public String getPublishDocsCommand() {
return this.publishDocsCommand;
} }
public void setPublishDocsCommands(String[] publishDocsCommands) { @Override
this.publishDocsCommands = publishDocsCommands; public void setPublishDocsCommand(String publishDocsCommand) {
this.publishDocsCommand = publishDocsCommand;
} }
@Override
public String getGenerateReleaseTrainDocsCommand() { public String getGenerateReleaseTrainDocsCommand() {
return this.generateReleaseTrainDocsCommand; return this.generateReleaseTrainDocsCommand;
} }
@Override
public void setGenerateReleaseTrainDocsCommand( public void setGenerateReleaseTrainDocsCommand(
String generateReleaseTrainDocsCommand) { String generateReleaseTrainDocsCommand) {
this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand; this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand;
} }
@Override
public String getSystemProperties() { public String getSystemProperties() {
return this.systemProperties; return this.systemProperties;
} }
@Override
public void setSystemProperties(String systemProperties) { public void setSystemProperties(String systemProperties) {
this.systemProperties = systemProperties; this.systemProperties = systemProperties;
} }
@@ -1171,7 +1192,7 @@ public class ReleaserProperties implements Serializable {
public String toString() { public String toString() {
return "Bash{" + "buildCommand='" + this.buildCommand + '\'' return "Bash{" + "buildCommand='" + this.buildCommand + '\''
+ ", deployCommand='" + this.deployCommand + '\'' + ", deployCommand='" + this.deployCommand + '\''
+ ", publishDocsCommands=" + Arrays.toString(this.publishDocsCommands) + ", publishDocsCommands=" + this.publishDocsCommand
+ "generateReleaseTrainDocsCommand='" + "generateReleaseTrainDocsCommand='"
+ this.generateReleaseTrainDocsCommand + '\'' + ", waitTimeInMinutes=" + this.generateReleaseTrainDocsCommand + '\'' + ", waitTimeInMinutes="
+ this.waitTimeInMinutes + '}'; + this.waitTimeInMinutes + '}';
@@ -1234,8 +1255,7 @@ public class ReleaserProperties implements Serializable {
* Command to be executed to publish documentation. If present "{{version}}" will * Command to be executed to publish documentation. If present "{{version}}" will
* be replaced by the provided version. * be replaced by the provided version.
*/ */
private String[] publishDocsCommands = { private String publishDocsCommand = "./gradlew publishDocs --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}";
"./gradlew publishDocs --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}" };
/** /**
* Command to be executed to generate release train documentation. * Command to be executed to generate release train documentation.
@@ -1254,10 +1274,12 @@ public class ReleaserProperties implements Serializable {
*/ */
private long waitTimeInMinutes = 20; private long waitTimeInMinutes = 20;
@Override
public String getBuildCommand() { public String getBuildCommand() {
return this.buildCommand; return this.buildCommand;
} }
@Override
public void setBuildCommand(String buildCommand) { public void setBuildCommand(String buildCommand) {
this.buildCommand = buildCommand; this.buildCommand = buildCommand;
} }
@@ -1270,43 +1292,53 @@ public class ReleaserProperties implements Serializable {
this.waitTimeInMinutes = waitTimeInMinutes; this.waitTimeInMinutes = waitTimeInMinutes;
} }
@Override
public String getDeployCommand() { public String getDeployCommand() {
return this.deployCommand; return this.deployCommand;
} }
@Override
public void setDeployCommand(String deployCommand) { public void setDeployCommand(String deployCommand) {
this.deployCommand = deployCommand; this.deployCommand = deployCommand;
} }
@Override
public String getDeployGuidesCommand() { public String getDeployGuidesCommand() {
return this.deployGuidesCommand; return this.deployGuidesCommand;
} }
@Override
public void setDeployGuidesCommand(String deployGuidesCommand) { public void setDeployGuidesCommand(String deployGuidesCommand) {
this.deployGuidesCommand = deployGuidesCommand; this.deployGuidesCommand = deployGuidesCommand;
} }
public String[] getPublishDocsCommands() { @Override
return this.publishDocsCommands; public String getPublishDocsCommand() {
return this.publishDocsCommand;
} }
public void setPublishDocsCommands(String[] publishDocsCommands) { @Override
this.publishDocsCommands = publishDocsCommands; public void setPublishDocsCommand(String publishDocsCommand) {
this.publishDocsCommand = publishDocsCommand;
} }
@Override
public String getGenerateReleaseTrainDocsCommand() { public String getGenerateReleaseTrainDocsCommand() {
return this.generateReleaseTrainDocsCommand; return this.generateReleaseTrainDocsCommand;
} }
@Override
public void setGenerateReleaseTrainDocsCommand( public void setGenerateReleaseTrainDocsCommand(
String generateReleaseTrainDocsCommand) { String generateReleaseTrainDocsCommand) {
this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand; this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand;
} }
@Override
public String getSystemProperties() { public String getSystemProperties() {
return this.systemProperties; return this.systemProperties;
} }
@Override
public void setSystemProperties(String systemProperties) { public void setSystemProperties(String systemProperties) {
this.systemProperties = systemProperties; this.systemProperties = systemProperties;
} }
@@ -1336,7 +1368,7 @@ public class ReleaserProperties implements Serializable {
.add("buildCommand='" + buildCommand + "'") .add("buildCommand='" + buildCommand + "'")
.add("deployCommand='" + deployCommand + "'") .add("deployCommand='" + deployCommand + "'")
.add("deployGuidesCommand='" + deployGuidesCommand + "'") .add("deployGuidesCommand='" + deployGuidesCommand + "'")
.add("publishDocsCommands=" + Arrays.toString(publishDocsCommands)) .add("publishDocsCommands=" + publishDocsCommand)
.add("generateReleaseTrainDocsCommand='" .add("generateReleaseTrainDocsCommand='"
+ generateReleaseTrainDocsCommand + "'") + generateReleaseTrainDocsCommand + "'")
.add("systemProperties='" + systemProperties + "'") .add("systemProperties='" + systemProperties + "'")

View File

@@ -107,8 +107,8 @@ public class ReleaserPropertiesUpdater implements Closeable {
commandCopy::setDeployCommand); commandCopy::setDeployCommand);
overrideStringIfPresent(fromProject::getGenerateReleaseTrainDocsCommand, overrideStringIfPresent(fromProject::getGenerateReleaseTrainDocsCommand,
commandCopy::setGenerateReleaseTrainDocsCommand); commandCopy::setGenerateReleaseTrainDocsCommand);
overrideArrayIfPresent(fromProject::getPublishDocsCommands, overrideStringIfPresent(fromProject::getPublishDocsCommand,
commandCopy::setPublishDocsCommands); commandCopy::setPublishDocsCommand);
overrideStringIfPresent(fromProject::getDeployGuidesCommand, overrideStringIfPresent(fromProject::getDeployGuidesCommand,
commandCopy::setDeployGuidesCommand); commandCopy::setDeployGuidesCommand);
overrideStringIfPresent(fromProject::getSystemProperties, overrideStringIfPresent(fromProject::getSystemProperties,

View File

@@ -189,9 +189,13 @@ public class ProjectCommandExecutor {
public void publishDocs(ReleaserProperties properties, ProjectVersion originalVersion, public void publishDocs(ReleaserProperties properties, ProjectVersion originalVersion,
ProjectVersion changedVersion) { ProjectVersion changedVersion) {
try { try {
for (String command : new CommandPicker(properties).publishDocsCommands()) { String providedCommand = new CommandPicker(properties)
.publishDocsCommand(originalVersion);
String[] providedCommands = StringUtils
.delimitedListToStringArray(providedCommand, "&&");
for (String command : providedCommands) {
command = replaceAllPlaceHolders(originalVersion, changedVersion, command = replaceAllPlaceHolders(originalVersion, changedVersion,
command); command.trim());
String[] commands = command.split(" "); String[] commands = command.split(" ");
runCommand(properties, commands); runCommand(properties, commands);
} }
@@ -379,14 +383,16 @@ class CommandPicker {
return releaserProperties.getBash().getSystemProperties(); return releaserProperties.getBash().getSystemProperties();
} }
public String[] publishDocsCommands() { public String publishDocsCommand(ProjectVersion version) {
if (projectType == ProjectType.GRADLE) { if (projectType == ProjectType.GRADLE) {
return releaserProperties.getGradle().getPublishDocsCommands(); return mavenCommandWithSystemProps(
releaserProperties.getGradle().getPublishDocsCommand(), version);
} }
else if (projectType == ProjectType.MAVEN) { else if (projectType == ProjectType.MAVEN) {
return releaserProperties.getMaven().getPublishDocsCommands(); return mavenCommandWithSystemProps(
releaserProperties.getMaven().getPublishDocsCommand(), version);
} }
return releaserProperties.getBash().getPublishDocsCommands(); return releaserProperties.getBash().getPublishDocsCommand();
} }
String systemPropertiesPlaceholder() { String systemPropertiesPlaceholder() {

View File

@@ -425,8 +425,8 @@ public class ProjectCommandExecutorTests {
@Test @Test
public void should_successfully_execute_a_publish_docs_command() throws Exception { public void should_successfully_execute_a_publish_docs_command() throws Exception {
ReleaserProperties properties = new ReleaserProperties(); ReleaserProperties properties = new ReleaserProperties();
properties.getBash().setPublishDocsCommands(new String[] { "ls -al", properties.getBash().setPublishDocsCommand(
"echo {{version}} {{oldVersion}} {{nextVersion}}" }); "ls -al && echo {{version}} {{oldVersion}} {{nextVersion}}");
properties.setWorkingDir(tmpFile("/builder/resolved").getPath()); properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
TestReleaserProcessExecutor executor = testExecutor(properties.getWorkingDir()); TestReleaserProcessExecutor executor = testExecutor(properties.getWorkingDir());
ProjectCommandExecutor builder = new ProjectCommandExecutor() { ProjectCommandExecutor builder = new ProjectCommandExecutor() {
@@ -448,8 +448,8 @@ public class ProjectCommandExecutorTests {
public void should_successfully_execute_a_publish_docs_command_with_sys_props_placeholder() public void should_successfully_execute_a_publish_docs_command_with_sys_props_placeholder()
throws Exception { throws Exception {
ReleaserProperties properties = new ReleaserProperties(); ReleaserProperties properties = new ReleaserProperties();
properties.getBash().setPublishDocsCommands( properties.getBash().setPublishDocsCommand(
new String[] { "echo {{systemProps}} 1", "echo {{systemProps}} 2" }); "echo {{systemProps}} 1 && echo {{systemProps}} 2");
properties.getBash().setSystemProperties("-Dhello=world -Dfoo=bar"); properties.getBash().setSystemProperties("-Dhello=world -Dfoo=bar");
properties.setWorkingDir(tmpFile("/builder/resolved").getPath()); properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
TestReleaserProcessExecutor executor = testExecutor(properties.getWorkingDir()); TestReleaserProcessExecutor executor = testExecutor(properties.getWorkingDir());
@@ -463,8 +463,9 @@ public class ProjectCommandExecutorTests {
builder.publishDocs(properties, original(), builder.publishDocs(properties, original(),
new ProjectVersion("foo", "Finchley.RELEASE")); new ProjectVersion("foo", "Finchley.RELEASE"));
then(asString(tmpFile("/builder/resolved/resolved.log"))) String s = asString(tmpFile("/builder/resolved/resolved.log"));
.contains("-Dhello=world -Dfoo=bar 2"); System.out.println("====> " + s);
then(s).contains("-Dhello=world -Dfoo=bar 2");
then(executor.counter).isEqualTo(2); then(executor.counter).isEqualTo(2);
} }
@@ -472,8 +473,7 @@ public class ProjectCommandExecutorTests {
public void should_successfully_execute_a_publish_docs_command_and_substitute_the_version() public void should_successfully_execute_a_publish_docs_command_and_substitute_the_version()
throws Exception { throws Exception {
ReleaserProperties properties = new ReleaserProperties(); ReleaserProperties properties = new ReleaserProperties();
properties.getBash() properties.getBash().setPublishDocsCommand("echo '{{version}}'");
.setPublishDocsCommands(new String[] { "echo '{{version}}'" });
properties.setWorkingDir(tmpFile("/builder/resolved").getPath()); properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
TestReleaserProcessExecutor executor = testExecutor(properties.getWorkingDir()); TestReleaserProcessExecutor executor = testExecutor(properties.getWorkingDir());
ProjectCommandExecutor builder = new ProjectCommandExecutor() { ProjectCommandExecutor builder = new ProjectCommandExecutor() {
@@ -515,8 +515,7 @@ public class ProjectCommandExecutorTests {
@Test @Test
public void should_throw_exception_when_publish_docs_command_took_too_long_to_execute() { public void should_throw_exception_when_publish_docs_command_took_too_long_to_execute() {
ReleaserProperties properties = new ReleaserProperties(); ReleaserProperties properties = new ReleaserProperties();
properties.getBash() properties.getBash().setPublishDocsCommand("sleep 1 && sleep 1");
.setPublishDocsCommands(new String[] { "sleep 1", "sleep 1" });
properties.getBash().setWaitTimeInMinutes(0); properties.getBash().setWaitTimeInMinutes(0);
properties.setWorkingDir(tmpFile("/builder/unresolved").getPath()); properties.setWorkingDir(tmpFile("/builder/unresolved").getPath());
ProjectCommandExecutor builder = projectBuilder(properties); ProjectCommandExecutor builder = projectBuilder(properties);

View File

@@ -62,11 +62,7 @@ releaser:
build-command: "./mvnw clean install -B -Pdocs {{systemProps}}" build-command: "./mvnw clean install -B -Pdocs {{systemProps}}"
deploy-command: "./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}}" deploy-command: "./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}}"
deploy-guides-command: "./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}}" deploy-guides-command: "./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}}"
publish-docs-commands: publish-docs-command: "mkdir -p target && wget https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/ghpages.sh -O target/gh-pages.sh && chmod +x target/gh-pages.sh && ./target/gh-pages.sh -v {{version}} -c"
- "mkdir -p target"
- "wget https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/ghpages.sh -O target/gh-pages.sh"
- "chmod +x target/gh-pages.sh"
- "./target/gh-pages.sh -v {{version}} -c"
generate-release-train-docs-command: "bash release_train.sh --retrieveversions --version {{version}} --ghpages --auto" generate-release-train-docs-command: "bash release_train.sh --retrieveversions --version {{version}} --ghpages --auto"
system-properties: "" system-properties: ""
wait-time-in-minutes: 20 wait-time-in-minutes: 20
@@ -74,8 +70,7 @@ releaser:
build-command: 'echo "{{systemProps}}"' build-command: 'echo "{{systemProps}}"'
deploy-command: 'echo "{{systemProps}}"' deploy-command: 'echo "{{systemProps}}"'
deploy-guides-command: 'echo "{{systemProps}}"' deploy-guides-command: 'echo "{{systemProps}}"'
publish-docs-commands: publish-docs-command: 'echo "{{systemProps}}"'
- 'echo "{{systemProps}}"'
generate-release-train-docs-command: 'echo "{{systemProps}}"' generate-release-train-docs-command: 'echo "{{systemProps}}"'
system-properties: "" system-properties: ""
wait-time-in-minutes: 20 wait-time-in-minutes: 20
@@ -94,8 +89,7 @@ releaser:
build-command: "./gradlew clean build publishToMavenLocal --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}" build-command: "./gradlew clean build publishToMavenLocal --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}"
deploy-command: "./gradlew publish --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}" deploy-command: "./gradlew publish --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}"
deploy-guides-command: "./gradlew clean build deployGuides --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}" deploy-guides-command: "./gradlew clean build deployGuides --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}"
publish-docs-commands: publish-docs-command: "echo 'TODO'"
- "echo 'TODO'"
generate-release-train-docs-command: "echo 'TODO'" generate-release-train-docs-command: "echo 'TODO'"
system-properties: "" system-properties: ""
wait-time-in-minutes: 20 wait-time-in-minutes: 20

View File

@@ -50,7 +50,7 @@ public class ArgsBuilder {
"releaser.maven.build-command=echo build", "releaser.maven.build-command=echo build",
"releaser.maven.deploy-command=echo deploy", "releaser.maven.deploy-command=echo deploy",
"releaser.maven.deploy-guides-command=echo guides", "releaser.maven.deploy-guides-command=echo guides",
"releaser.maven.publish-docs-commands=echo docs", "releaser.maven.publish-docs-command=echo docs",
"releaser.maven.generate-release-train-docs-command=echo releaseTrainDocs", "releaser.maven.generate-release-train-docs-command=echo releaseTrainDocs",
"releaser.working-dir=" + project.getPath(), "releaser.working-dir=" + project.getPath(),
"releaser.git.spring-project-url=" + tmpFile("spring-cloud").getAbsolutePath() + "/", "releaser.git.spring-project-url=" + tmpFile("spring-cloud").getAbsolutePath() + "/",
@@ -113,8 +113,8 @@ public class ArgsBuilder {
} }
public ArgsBuilder mavenPublishCommand(String command) throws Exception { public ArgsBuilder mavenPublishCommand(String command) throws Exception {
removeIfPresent("releaser.maven.publish-docs-commands"); removeIfPresent("releaser.maven.publish-docs-command");
this.args.add("releaser.maven.publish-docs-commands=" + command); this.args.add("releaser.maven.publish-docs-command=" + command);
return this; return this;
} }