Skip to content
Permalink
Browse files

JENKINS-30762 - Environment script fails with job name shorter than 3…

… characters
  • Loading branch information...
dawidmalina committed Nov 15, 2015
1 parent 334383d commit e325a08c81daa202bc60a92bc9592a5a5197884f
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 e325a08

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