Skip to content
Permalink
Browse files

Merge pull request #8 from dawidmalina/JENKINS-30762

JENKINS-30762 - Environment script fails with job name shorter than 3 characters
  • Loading branch information...
dawidmalina committed Nov 15, 2015
2 parents 01d1d45 + e325a08 commit 545b348ebc96bddb1dcecce64a1bb99c0f3a16cc
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/java/com/lookout/jenkins/EnvironmentScript.java
@@ -103,8 +103,10 @@ private Environment generateEnvironment(AbstractBuild<?, ?> build,
ByteArrayOutputStream commandOutput = new ByteArrayOutputStream();
int returnCode = -1;
try {
// Make sure prefix will always be more than 3 letters
final String prefix = "env-" + build.getProject().getName();
// Create a file in the system temporary directory with our script in it.
scriptFile = ws.createTextTempFile(build.getProject().getName(), ".sh", script, false);
scriptFile = ws.createTextTempFile(prefix, ".sh", script, false);

// Then we execute the script, putting STDOUT in commandOutput.
returnCode = launcher.launch().cmds(buildCommandLine(scriptFile))

0 comments on commit 545b348

Please sign in to comment.
You can’t perform that action at this time.