Skip to content

Commit

Permalink
Merge pull request #10 from red-gate/pom-INFRA-588-update
Browse files Browse the repository at this point in the history
INFRA-588: POM update
  • Loading branch information
MichelleTaylorRG committed Oct 20, 2016
2 parents e9c08a7 + e4ca1b3 commit 0352c19
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
14 changes: 12 additions & 2 deletions pom.xml
Expand Up @@ -5,8 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<!-- Baseline Jenkins version you use to build and test the plugin. Users must have this version or newer to run. -->
<version>1.580.1</version>
<version>2.5</version>
</parent>

<groupId>com.redgate.plugins.redgatesqlci</groupId>
Expand All @@ -30,8 +29,18 @@
<name>Peter Gerrard</name>
<email>peter.gerrard@red-gate.com</email>
</developer>
<developer>
<id>Michelle_Taylor</id>
<name>Michelle Taylor</name>
<email>michelle.taylor@red-gate.com</email>
</developer>
</developers>

<properties>
<!-- Baseline Jenkins version you use to build and test the plugin. Users must have this version or newer to run. -->
<jenkins.version>1.580.1</jenkins.version>
</properties>

<scm>
<connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
<developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
Expand All @@ -45,6 +54,7 @@
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/redgatesqlci/BuildBuilder.java
Expand Up @@ -141,6 +141,10 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
ArrayList<String> params = new ArrayList<String>();

FilePath checkOutPath = build.getWorkspace();
if (checkOutPath == null)
{
return false;
}
params.add("Build");

if (getDbFolder().equals("subfolder")) {
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/redgatesqlci/Utils.java
Expand Up @@ -40,7 +40,7 @@ public static boolean runSQLCIWithParams(AbstractBuild build, Launcher launcher,
allLocations = allLocations.concat(possibleLocation + " ");
}

if(sqlCiLocation == "")
if(sqlCiLocation.isEmpty())
{
listener.error("SQLCI.ps1 cannot be found. Checked " + allLocations + ". Please install Redgate DLM Automation 2 on this agent.");
return false;
Expand All @@ -56,7 +56,9 @@ public static boolean runSQLCIWithParams(AbstractBuild build, Launcher launcher,
procParams.add(5, "\"" + sqlCiLocation + "\"");
procParams.add(6, "-Verbose");

String longString = "\"" + getPowerShellExeLocation() + "\" -NonInteractive -ExecutionPolicy Bypass -File \"" + sqlCiLocation + "\"" + " -Verbose";
StringBuffer longStringBuffer = new StringBuffer();

longStringBuffer.append("\"" + getPowerShellExeLocation() + "\" -NonInteractive -ExecutionPolicy Bypass -File \"" + sqlCiLocation + "\"" + " -Verbose");

// Here we do some parameter fiddling. Existing quotes must be escaped with three slashes
// Then, we need to surround the part on the right of the = with quotes iff it has a space.
Expand All @@ -76,8 +78,9 @@ public static boolean runSQLCIWithParams(AbstractBuild build, Launcher launcher,
}

procParams.add(param);
longString += " " + fixedParam;
longStringBuffer.append(" " + fixedParam);
}
String longString = longStringBuffer.toString();

// Run SQL CI with parameters. Send output and error streams to logger.Map<String, String> vars = new HashMap<String, String>();
Map<String, String> vars = new HashMap<String, String>();
Expand All @@ -88,7 +91,7 @@ public static boolean runSQLCIWithParams(AbstractBuild build, Launcher launcher,
Launcher.ProcStarter procStarter = launcher.new ProcStarter();

// Set process environment variables to system environment variables. This shouldn't be necessary!
EnvVars envVars = new EnvVars();
EnvVars envVars;
try {
envVars = build.getEnvironment(listener);
vars.putAll(envVars);
Expand Down

0 comments on commit 0352c19

Please sign in to comment.