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:
@@ -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-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.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.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.
|
||||
@@ -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.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.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.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.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.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.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?
|
||||
|
||||
@@ -24,11 +24,8 @@ releaser:
|
||||
build-command: "./mvnw clean install -B -Pdocs {{systemProps}}"
|
||||
deploy-command: "./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}}"
|
||||
deploy-guides-command: "./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}}"
|
||||
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"
|
||||
|
||||
publish-docs-command: "./mvnw deploy -DskipTests -B -Pfast,deploy,docs {{systemProps}}"
|
||||
generate-release-train-docs-command: "bash release_train.sh --retrieveversions --version {{version}} --ghpages --auto"
|
||||
sagan:
|
||||
update-sagan: true
|
||||
|
||||
@@ -63,8 +63,7 @@ releaser:
|
||||
build-command: "./mvnw clean install -B -Pdocs {{systemProps}}"
|
||||
deploy-command: "./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}}"
|
||||
deploy-guides-command: "./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}}"
|
||||
publish-docs-commands:
|
||||
- "./mvnw deploy -DskipTests -B -Pfast,deploy,docs -pl docs {{systemProps}}"
|
||||
publish-docs-command: "./mvnw deploy -DskipTests -B -Pfast,deploy,docs -pl docs {{systemProps}}"
|
||||
generate-release-train-docs-command: "./mvnw clean deploy -Pdocs,train-docs -pl train-docs"
|
||||
system-properties: ""
|
||||
wait-time-in-minutes: 20
|
||||
@@ -72,8 +71,7 @@ releaser:
|
||||
build-command: 'echo "{{systemProps}}"'
|
||||
deploy-command: 'echo "{{systemProps}}"'
|
||||
deploy-guides-command: 'echo "{{systemProps}}"'
|
||||
publish-docs-commands:
|
||||
- 'echo "{{systemProps}}"'
|
||||
publish-docs-command: 'echo "{{systemProps}}"'
|
||||
generate-release-train-docs-command: 'echo "{{systemProps}}"'
|
||||
system-properties: ""
|
||||
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}}"
|
||||
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}}"
|
||||
publish-docs-commands:
|
||||
- "echo 'TODO'"
|
||||
publish-docs-command: "echo 'TODO'"
|
||||
generate-release-train-docs-command: "echo 'TODO'"
|
||||
system-properties: ""
|
||||
wait-time-in-minutes: 20
|
||||
|
||||
@@ -18,7 +18,6 @@ package releaser.internal;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -251,12 +250,12 @@ public class ReleaserProperties implements Serializable {
|
||||
/**
|
||||
* @return docs publishing commands
|
||||
*/
|
||||
String[] getPublishDocsCommands();
|
||||
String getPublishDocsCommand();
|
||||
|
||||
/**
|
||||
* @param publishDocsCommands to set
|
||||
*/
|
||||
void setPublishDocsCommands(String[] publishDocsCommands);
|
||||
void setPublishDocsCommand(String publishDocsCommands);
|
||||
|
||||
/**
|
||||
* @return generate release train docs command
|
||||
@@ -962,15 +961,8 @@ public class ReleaserProperties implements Serializable {
|
||||
**/
|
||||
private String deployGuidesCommand = "./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}}";
|
||||
|
||||
/**
|
||||
* Command to be executed to publish documentation. If present "{{version}}" will
|
||||
* be replaced by the provided version.
|
||||
*/
|
||||
private String[] publishDocsCommands = { "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" };
|
||||
|
||||
private String publishDocsCommand = "./mvnw deploy -DskipTests -B -Pfast,deploy,docs -pl docs {{systemProps}}";
|
||||
|
||||
/**
|
||||
* Command to be executed to generate release train documentation.
|
||||
@@ -990,10 +982,12 @@ public class ReleaserProperties implements Serializable {
|
||||
*/
|
||||
private long waitTimeInMinutes = 20;
|
||||
|
||||
@Override
|
||||
public String getBuildCommand() {
|
||||
return this.buildCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBuildCommand(String buildCommand) {
|
||||
this.buildCommand = buildCommand;
|
||||
}
|
||||
@@ -1006,43 +1000,53 @@ public class ReleaserProperties implements Serializable {
|
||||
this.waitTimeInMinutes = waitTimeInMinutes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeployCommand() {
|
||||
return this.deployCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeployCommand(String deployCommand) {
|
||||
this.deployCommand = deployCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeployGuidesCommand() {
|
||||
return this.deployGuidesCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeployGuidesCommand(String deployGuidesCommand) {
|
||||
this.deployGuidesCommand = deployGuidesCommand;
|
||||
}
|
||||
|
||||
public String[] getPublishDocsCommands() {
|
||||
return this.publishDocsCommands;
|
||||
@Override
|
||||
public String getPublishDocsCommand() {
|
||||
return this.publishDocsCommand;
|
||||
}
|
||||
|
||||
public void setPublishDocsCommands(String[] publishDocsCommands) {
|
||||
this.publishDocsCommands = publishDocsCommands;
|
||||
@Override
|
||||
public void setPublishDocsCommand(String publishDocsCommand) {
|
||||
this.publishDocsCommand = publishDocsCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGenerateReleaseTrainDocsCommand() {
|
||||
return this.generateReleaseTrainDocsCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGenerateReleaseTrainDocsCommand(
|
||||
String generateReleaseTrainDocsCommand) {
|
||||
this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemProperties() {
|
||||
return this.systemProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSystemProperties(String systemProperties) {
|
||||
this.systemProperties = systemProperties;
|
||||
}
|
||||
@@ -1051,7 +1055,7 @@ public class ReleaserProperties implements Serializable {
|
||||
public String toString() {
|
||||
return "Maven{" + "buildCommand='" + this.buildCommand + '\''
|
||||
+ ", deployCommand='" + this.deployCommand + '\''
|
||||
+ ", publishDocsCommands=" + Arrays.toString(this.publishDocsCommands)
|
||||
+ ", publishDocsCommand=" + this.publishDocsCommand
|
||||
+ "generateReleaseTrainDocsCommand='"
|
||||
+ this.generateReleaseTrainDocsCommand + '\'' + ", waitTimeInMinutes="
|
||||
+ this.waitTimeInMinutes + '}';
|
||||
@@ -1093,8 +1097,7 @@ public class ReleaserProperties implements Serializable {
|
||||
* be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot
|
||||
* version and "{{oldVersion}}" with the version before version updating.
|
||||
*/
|
||||
private String[] publishDocsCommands = { "mkdir -p target",
|
||||
"echo \"{{version}}\"" };
|
||||
private String publishDocsCommand = "mkdir -p target && echo \"{{version}}\"";
|
||||
|
||||
/**
|
||||
* Command to be executed to generate release train documentation.
|
||||
@@ -1113,10 +1116,12 @@ public class ReleaserProperties implements Serializable {
|
||||
*/
|
||||
private long waitTimeInMinutes = 20;
|
||||
|
||||
@Override
|
||||
public String getBuildCommand() {
|
||||
return this.buildCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBuildCommand(String buildCommand) {
|
||||
this.buildCommand = buildCommand;
|
||||
}
|
||||
@@ -1129,43 +1134,53 @@ public class ReleaserProperties implements Serializable {
|
||||
this.waitTimeInMinutes = waitTimeInMinutes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeployCommand() {
|
||||
return this.deployCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeployCommand(String deployCommand) {
|
||||
this.deployCommand = deployCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeployGuidesCommand() {
|
||||
return this.deployGuidesCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeployGuidesCommand(String deployGuidesCommand) {
|
||||
this.deployGuidesCommand = deployGuidesCommand;
|
||||
}
|
||||
|
||||
public String[] getPublishDocsCommands() {
|
||||
return this.publishDocsCommands;
|
||||
@Override
|
||||
public String getPublishDocsCommand() {
|
||||
return this.publishDocsCommand;
|
||||
}
|
||||
|
||||
public void setPublishDocsCommands(String[] publishDocsCommands) {
|
||||
this.publishDocsCommands = publishDocsCommands;
|
||||
@Override
|
||||
public void setPublishDocsCommand(String publishDocsCommand) {
|
||||
this.publishDocsCommand = publishDocsCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGenerateReleaseTrainDocsCommand() {
|
||||
return this.generateReleaseTrainDocsCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGenerateReleaseTrainDocsCommand(
|
||||
String generateReleaseTrainDocsCommand) {
|
||||
this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemProperties() {
|
||||
return this.systemProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSystemProperties(String systemProperties) {
|
||||
this.systemProperties = systemProperties;
|
||||
}
|
||||
@@ -1174,7 +1189,7 @@ public class ReleaserProperties implements Serializable {
|
||||
public String toString() {
|
||||
return "Bash{" + "buildCommand='" + this.buildCommand + '\''
|
||||
+ ", deployCommand='" + this.deployCommand + '\''
|
||||
+ ", publishDocsCommands=" + Arrays.toString(this.publishDocsCommands)
|
||||
+ ", publishDocsCommands=" + this.publishDocsCommand
|
||||
+ "generateReleaseTrainDocsCommand='"
|
||||
+ this.generateReleaseTrainDocsCommand + '\'' + ", waitTimeInMinutes="
|
||||
+ this.waitTimeInMinutes + '}';
|
||||
@@ -1237,8 +1252,7 @@ public class ReleaserProperties implements Serializable {
|
||||
* Command to be executed to publish documentation. If present "{{version}}" will
|
||||
* be replaced by the provided version.
|
||||
*/
|
||||
private String[] publishDocsCommands = {
|
||||
"./gradlew publishDocs --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}" };
|
||||
private String publishDocsCommand = "./gradlew publishDocs --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}";
|
||||
|
||||
/**
|
||||
* Command to be executed to generate release train documentation.
|
||||
@@ -1257,10 +1271,12 @@ public class ReleaserProperties implements Serializable {
|
||||
*/
|
||||
private long waitTimeInMinutes = 20;
|
||||
|
||||
@Override
|
||||
public String getBuildCommand() {
|
||||
return this.buildCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBuildCommand(String buildCommand) {
|
||||
this.buildCommand = buildCommand;
|
||||
}
|
||||
@@ -1273,43 +1289,53 @@ public class ReleaserProperties implements Serializable {
|
||||
this.waitTimeInMinutes = waitTimeInMinutes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeployCommand() {
|
||||
return this.deployCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeployCommand(String deployCommand) {
|
||||
this.deployCommand = deployCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeployGuidesCommand() {
|
||||
return this.deployGuidesCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeployGuidesCommand(String deployGuidesCommand) {
|
||||
this.deployGuidesCommand = deployGuidesCommand;
|
||||
}
|
||||
|
||||
public String[] getPublishDocsCommands() {
|
||||
return this.publishDocsCommands;
|
||||
@Override
|
||||
public String getPublishDocsCommand() {
|
||||
return this.publishDocsCommand;
|
||||
}
|
||||
|
||||
public void setPublishDocsCommands(String[] publishDocsCommands) {
|
||||
this.publishDocsCommands = publishDocsCommands;
|
||||
@Override
|
||||
public void setPublishDocsCommand(String publishDocsCommand) {
|
||||
this.publishDocsCommand = publishDocsCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGenerateReleaseTrainDocsCommand() {
|
||||
return this.generateReleaseTrainDocsCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGenerateReleaseTrainDocsCommand(
|
||||
String generateReleaseTrainDocsCommand) {
|
||||
this.generateReleaseTrainDocsCommand = generateReleaseTrainDocsCommand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemProperties() {
|
||||
return this.systemProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSystemProperties(String systemProperties) {
|
||||
this.systemProperties = systemProperties;
|
||||
}
|
||||
@@ -1339,7 +1365,7 @@ public class ReleaserProperties implements Serializable {
|
||||
.add("buildCommand='" + buildCommand + "'")
|
||||
.add("deployCommand='" + deployCommand + "'")
|
||||
.add("deployGuidesCommand='" + deployGuidesCommand + "'")
|
||||
.add("publishDocsCommands=" + Arrays.toString(publishDocsCommands))
|
||||
.add("publishDocsCommands=" + publishDocsCommand)
|
||||
.add("generateReleaseTrainDocsCommand='"
|
||||
+ generateReleaseTrainDocsCommand + "'")
|
||||
.add("systemProperties='" + systemProperties + "'")
|
||||
|
||||
@@ -107,8 +107,8 @@ public class ReleaserPropertiesUpdater implements Closeable {
|
||||
commandCopy::setDeployCommand);
|
||||
overrideStringIfPresent(fromProject::getGenerateReleaseTrainDocsCommand,
|
||||
commandCopy::setGenerateReleaseTrainDocsCommand);
|
||||
overrideArrayIfPresent(fromProject::getPublishDocsCommands,
|
||||
commandCopy::setPublishDocsCommands);
|
||||
overrideStringIfPresent(fromProject::getPublishDocsCommand,
|
||||
commandCopy::setPublishDocsCommand);
|
||||
overrideStringIfPresent(fromProject::getDeployGuidesCommand,
|
||||
commandCopy::setDeployGuidesCommand);
|
||||
overrideStringIfPresent(fromProject::getSystemProperties,
|
||||
|
||||
@@ -189,9 +189,13 @@ public class ProjectCommandExecutor {
|
||||
public void publishDocs(ReleaserProperties properties, ProjectVersion originalVersion,
|
||||
ProjectVersion changedVersion) {
|
||||
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);
|
||||
command.trim());
|
||||
String[] commands = command.split(" ");
|
||||
runCommand(properties, commands);
|
||||
}
|
||||
@@ -379,14 +383,16 @@ class CommandPicker {
|
||||
return releaserProperties.getBash().getSystemProperties();
|
||||
}
|
||||
|
||||
public String[] publishDocsCommands() {
|
||||
public String publishDocsCommand(ProjectVersion version) {
|
||||
if (projectType == ProjectType.GRADLE) {
|
||||
return releaserProperties.getGradle().getPublishDocsCommands();
|
||||
return mavenCommandWithSystemProps(
|
||||
releaserProperties.getGradle().getPublishDocsCommand(), version);
|
||||
}
|
||||
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() {
|
||||
|
||||
@@ -425,8 +425,8 @@ public class ProjectCommandExecutorTests {
|
||||
@Test
|
||||
public void should_successfully_execute_a_publish_docs_command() throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getBash().setPublishDocsCommands(new String[] { "ls -al",
|
||||
"echo {{version}} {{oldVersion}} {{nextVersion}}" });
|
||||
properties.getBash().setPublishDocsCommand(
|
||||
"ls -al && echo {{version}} {{oldVersion}} {{nextVersion}}");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
TestReleaserProcessExecutor executor = testExecutor(properties.getWorkingDir());
|
||||
ProjectCommandExecutor builder = new ProjectCommandExecutor() {
|
||||
@@ -448,8 +448,8 @@ public class ProjectCommandExecutorTests {
|
||||
public void should_successfully_execute_a_publish_docs_command_with_sys_props_placeholder()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getBash().setPublishDocsCommands(
|
||||
new String[] { "echo {{systemProps}} 1", "echo {{systemProps}} 2" });
|
||||
properties.getBash().setPublishDocsCommand(
|
||||
"echo {{systemProps}} 1 && echo {{systemProps}} 2");
|
||||
properties.getBash().setSystemProperties("-Dhello=world -Dfoo=bar");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
TestReleaserProcessExecutor executor = testExecutor(properties.getWorkingDir());
|
||||
@@ -463,8 +463,9 @@ public class ProjectCommandExecutorTests {
|
||||
builder.publishDocs(properties, original(),
|
||||
new ProjectVersion("foo", "Finchley.RELEASE"));
|
||||
|
||||
then(asString(tmpFile("/builder/resolved/resolved.log")))
|
||||
.contains("-Dhello=world -Dfoo=bar 2");
|
||||
String s = asString(tmpFile("/builder/resolved/resolved.log"));
|
||||
System.out.println("====> " + s);
|
||||
then(s).contains("-Dhello=world -Dfoo=bar 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()
|
||||
throws Exception {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getBash()
|
||||
.setPublishDocsCommands(new String[] { "echo '{{version}}'" });
|
||||
properties.getBash().setPublishDocsCommand("echo '{{version}}'");
|
||||
properties.setWorkingDir(tmpFile("/builder/resolved").getPath());
|
||||
TestReleaserProcessExecutor executor = testExecutor(properties.getWorkingDir());
|
||||
ProjectCommandExecutor builder = new ProjectCommandExecutor() {
|
||||
@@ -515,8 +515,7 @@ public class ProjectCommandExecutorTests {
|
||||
@Test
|
||||
public void should_throw_exception_when_publish_docs_command_took_too_long_to_execute() {
|
||||
ReleaserProperties properties = new ReleaserProperties();
|
||||
properties.getBash()
|
||||
.setPublishDocsCommands(new String[] { "sleep 1", "sleep 1" });
|
||||
properties.getBash().setPublishDocsCommand("sleep 1 && sleep 1");
|
||||
properties.getBash().setWaitTimeInMinutes(0);
|
||||
properties.setWorkingDir(tmpFile("/builder/unresolved").getPath());
|
||||
ProjectCommandExecutor builder = projectBuilder(properties);
|
||||
|
||||
@@ -62,11 +62,7 @@ releaser:
|
||||
build-command: "./mvnw clean install -B -Pdocs {{systemProps}}"
|
||||
deploy-command: "./mvnw deploy -DskipTests -B -Pfast,deploy {{systemProps}}"
|
||||
deploy-guides-command: "./mvnw clean verify deploy -B -Pguides,integration -pl guides {{systemProps}}"
|
||||
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"
|
||||
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"
|
||||
generate-release-train-docs-command: "bash release_train.sh --retrieveversions --version {{version}} --ghpages --auto"
|
||||
system-properties: ""
|
||||
wait-time-in-minutes: 20
|
||||
@@ -74,8 +70,7 @@ releaser:
|
||||
build-command: 'echo "{{systemProps}}"'
|
||||
deploy-command: 'echo "{{systemProps}}"'
|
||||
deploy-guides-command: 'echo "{{systemProps}}"'
|
||||
publish-docs-commands:
|
||||
- 'echo "{{systemProps}}"'
|
||||
publish-docs-command: 'echo "{{systemProps}}"'
|
||||
generate-release-train-docs-command: 'echo "{{systemProps}}"'
|
||||
system-properties: ""
|
||||
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}}"
|
||||
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}}"
|
||||
publish-docs-commands:
|
||||
- "echo 'TODO'"
|
||||
publish-docs-command: "echo 'TODO'"
|
||||
generate-release-train-docs-command: "echo 'TODO'"
|
||||
system-properties: ""
|
||||
wait-time-in-minutes: 20
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ArgsBuilder {
|
||||
"releaser.maven.build-command=echo build",
|
||||
"releaser.maven.deploy-command=echo deploy",
|
||||
"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.working-dir=" + project.getPath(),
|
||||
"releaser.git.spring-project-url=" + tmpFile("spring-cloud").getAbsolutePath() + "/",
|
||||
@@ -113,8 +113,8 @@ public class ArgsBuilder {
|
||||
}
|
||||
|
||||
public ArgsBuilder mavenPublishCommand(String command) throws Exception {
|
||||
removeIfPresent("releaser.maven.publish-docs-commands");
|
||||
this.args.add("releaser.maven.publish-docs-commands=" + command);
|
||||
removeIfPresent("releaser.maven.publish-docs-command");
|
||||
this.args.add("releaser.maven.publish-docs-command=" + command);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user