We are currently using Jenkins version 2.7.
After upgrading from 1.647, we have the problem that environment variables 
created in a Groovy script are not exported and visible in a following 
shell script.
The projects are Maven-based.

System Groovy script:

// This script will set the artifact version to the environment variables 
"ARTIFACT_VERSION" and "SHORT_ARTIFACT_VERSION"

import hudson.model.*
import hudson.util.*

def currentBuild = Thread.currentThread()?.executable

def artifactVer = currentBuild.parent.modules.find{true}.version;
def artifactVerAction = new ParametersAction(new 
StringParameterValue("ARTIFACT_VERSION", artifactVer))
currentBuild?.addAction(artifactVerAction)

def shortArtifactVer = artifactVer - '-SNAPSHOT';
def shortArtifactVerAction = new ParametersAction(new 
StringParameterValue("SHORT_ARTIFACT_VERSION", shortArtifactVer))
currentBuild?.addAction(shortArtifactVerAction)


Shell script:

mkdir -p /home/rolotec/3rdparty/iD2ds/$ARTIFACT_VERSION
cp -u $WORKSPACE/target/tkfserver-$ARTIFACT_VERSION.jar 
/home/rolotec/3rdparty/iD2ds/$ARTIFACT_VERSION/


The problems started after an upgrade to Jenkins 2.5. Then also $WORKSPACE 
had no value. An upgrade to 2.6 seemed to solve that, but our own 
environment variables are still lost using 2.7.

Kind regards,
Niklas Oscarsson

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b0c50699-399b-4220-8ee9-51c84282b84e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to