diff --git a/src/main/java/io/jenkins/plugins/configops/database/LiquibaseRawCmdStep.java b/src/main/java/io/jenkins/plugins/configops/database/LiquibaseRawCmdStep.java index 7fe8f31..7ad3e07 100644 --- a/src/main/java/io/jenkins/plugins/configops/database/LiquibaseRawCmdStep.java +++ b/src/main/java/io/jenkins/plugins/configops/database/LiquibaseRawCmdStep.java @@ -123,12 +123,12 @@ protected Map run() throws Exception { step.getToolUrl(), step.getDatabaseId(), step.getCommand(), step.getArgs())); logger.log("Liquibase run command return code: %s", resp.getRetcode()); - if (StringUtils.isNotBlank(resp.getStdout())) { - logger.log("Liquibase run command stdout:\n%s", resp.getStdout()); - } if (StringUtils.isNotBlank(resp.getStderr())) { logger.log("Liquibase run command stderr:\n%s", resp.getStderr()); } + if (StringUtils.isNotBlank(resp.getStdout())) { + logger.log("Liquibase run command stdout:\n%s", resp.getStdout()); + } if (!resp.isSuccess()) { throw new ConfigOpsException("Execute liquibase run command unsuccessful"); } diff --git a/src/main/java/io/jenkins/plugins/configops/database/LiquibaseUpdateStep.java b/src/main/java/io/jenkins/plugins/configops/database/LiquibaseUpdateStep.java index dab16f2..ed43d2d 100644 --- a/src/main/java/io/jenkins/plugins/configops/database/LiquibaseUpdateStep.java +++ b/src/main/java/io/jenkins/plugins/configops/database/LiquibaseUpdateStep.java @@ -95,12 +95,12 @@ protected Map run() throws Exception { changelogRootPath.act(new RemoteExecutionCallable(step.getToolUrl(), step.getDatabaseId())); logger.log("Liquibase update return code: %s", resp.getRetcode()); - if (StringUtils.isNotBlank(resp.getStdout())) { - logger.log("Liquibase update stdout:\n%s", resp.getStdout()); - } if (StringUtils.isNotBlank(resp.getStderr())) { logger.log("Liquibase update stderr:\n%s", resp.getStderr()); } + if (StringUtils.isNotBlank(resp.getStdout())) { + logger.log("Liquibase update stdout:\n%s", resp.getStdout()); + } if (!resp.isSuccess()) { throw new ConfigOpsException("Execute liquibase update unsuccessful"); } diff --git a/src/main/java/io/jenkins/plugins/configops/model/req/NacosGetChangeSetReq.java b/src/main/java/io/jenkins/plugins/configops/model/req/NacosGetChangeSetReq.java index 986b04c..fb4ed20 100644 --- a/src/main/java/io/jenkins/plugins/configops/model/req/NacosGetChangeSetReq.java +++ b/src/main/java/io/jenkins/plugins/configops/model/req/NacosGetChangeSetReq.java @@ -18,4 +18,6 @@ public class NacosGetChangeSetReq implements Serializable { private String changeLogFile; private Integer count; + + private String contexts; } diff --git a/src/main/java/io/jenkins/plugins/configops/nacos/NacosChangeSetGetStep.java b/src/main/java/io/jenkins/plugins/configops/nacos/NacosChangeSetGetStep.java index a324caa..48b84a6 100644 --- a/src/main/java/io/jenkins/plugins/configops/nacos/NacosChangeSetGetStep.java +++ b/src/main/java/io/jenkins/plugins/configops/nacos/NacosChangeSetGetStep.java @@ -47,6 +47,8 @@ public class NacosChangeSetGetStep extends Step implements Serializable { private Integer count; + private String contexts; + @DataBoundConstructor public NacosChangeSetGetStep(String nacosId, String toolUrl, String changeLogFile) { this.nacosId = nacosId; @@ -59,6 +61,11 @@ public void setCount(Integer count) { this.count = count; } + @DataBoundSetter + public void setContexts(String contexts) { + this.contexts = contexts; + } + @Override public StepExecution start(StepContext context) throws Exception { return new StepExecutionImpl(context, this); @@ -87,8 +94,8 @@ protected NacosGetChangeSetResp run() throws Exception { if (!changeLog.exists()) { throw new IllegalArgumentException("Change log file not found"); } - NacosGetChangeSetResp resp = - changeLog.act(new RemoteCallable(step.getToolUrl(), step.getNacosId(), step.getCount())); + NacosGetChangeSetResp resp = changeLog.act( + new RemoteCallable(step.getToolUrl(), step.getNacosId(), step.getCount(), step.getContexts())); logger.log("Get ChangeSet from file: %s", step.getChangeLogFile()); if (CollectionUtils.isNotEmpty(resp.getChanges())) { for (NacosConfigDTO nc : resp.getChanges()) { @@ -107,13 +114,14 @@ private static class RemoteCallable extends MasterToSlaveFileCallable