Integrating RTC with Jenkins using multiple slaves
Our setup is as follows. We have the Jenkins software installed and setup as a master on a common tools server. The master is setup so that it does not perform any builds. And then we have several slaves that are a mix of Linux and Windows build hosts. We're running Jenkins 1.656 and Jazz 6.0.1 fix004; the Jenkins RTC plugin is 1.2.0.
Our developers have gotten used to using the RTC eclipse client for all their activity, including submitting build requests (we're currently setup to use RTC and the Rational Build Forge Agent model which we're trying to move off of because it is too limited for our needs). So we'd like to keep using the RTC build definition as the primary interface for interacting with "builds". I can't figure out how to set the "load directory" in RTC on the build definition and in Jenkins on each respective slave.
Most of our builds are written such that we "should" be able to build on any platform. So it stands to reason that the slave needs to set the "load directory"; the slave is the authority for its own file system. So if I have a Windows slave the "load directory" might be c:/rtc/ssd/src and on Linux it might be /opt/rtc/ssd/src. Now let’s say in Jenkins I've setup a "node property" called SRC_BASE which sets the appropriate value depending on the slave. It stands to reason that in RTC I need to consume that property when setting up my "Load Options" in the build definition. So again let’s say I set a new property SRC_HOME which is set to "${SRC_BASE}/proj-name".
You should notice that the build definition doesn't care what the actual base is, it's just adding to it so that each project is isolated uniquely on which ever slave it ends up running on.
The testing I've done so far I don't see how to bridge this gap. I end up with this:
Using build definition configuration.
Substituted the following build property variables:
team.scm.fetchDestination = ${SRC_HOME} --> team.scm.fetchDestination = ${SRC_BASE}/ccn/${buildResultUUID}
Fetching files from workspace "env.cfg.ccn.bld-repo-wksp".
RTC Checkout : Fetching files to fetch destination "/home/dcbuilder/workspace/env.cfg.ccn.bld/${SRC_BASE}/ccn/${buildResultUUID}" ...
RTC Checkout : Fetching Completed
Notice how SRC_BASE is not coming across from Jenkins, specifically the node configuration (aside from buildResultUUID which isn’t either). I have already setup the recommended “build parameters” and some additional ones, but the problem is the build definition can’t access those node level properties when needed for the “load directory”.
I put together a small shell script to execute which just echo’s various stuff. And I get this:
BUILD_TIMESTAMP = 20160502-142857386
BUILD_NUMBER = 136
BUILD_DISPLAY_NAME = #136
JOB_NAME = env.cfg.ccn.bld
BUILD_TAG = jenkins-env.cfg.ccn.bld-136
ANT_HOME = /opt/apache-ant-1.9.6
JAVA_HOME = /opt/jdk1.7.0_79
/opt/jdk1.7.0_79/bin/java
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
SRC_BASE = /opt/rtc/ssd/src
PKG_BASE = /opt/rtc/spindle/pkg
CCN_SRC_HOME = /opt/rtc/ssd/src/ccn/_eoT2sRCTEeakJpQrbzYzDQ
buildResultUUID = _eoT2sRCTEeakJpQrbzYzDQ
buildDefinitionId = env.cfg.ccn.bld-def
buildLabel =
repositoryAddress: https://jazzcm.dcsr.site:9445/ccm/
buildResultUUID: _eoT2sRCTEeakJpQrbzYzDQ
RTCBuildResultUUID: _eoT2sRCTEeakJpQrbzYzDQ
So the environment instantiated seems to have access to these properties, just not the build definition. Can I resolve this or what am I doing wrong with this setup…? Is there another way I should try to do this?
Accepted answer
The "node property" that is set in Jenkins is not available in RTC build definition.
When using a relative path in the build definition's load directory, it is resolved based on the Jenkins job's workspace directory. I believe this should help in your scenario.
Thanks,
Sridevi
Comments
1 vote
One other answer
Regarding path I usually work in two ways: on build definition I set up "." as load folder as the repository workspace is always loaded in the jenkins job's workspace (unless defined in the job, so you probably can just use the previously mentioned property, but it seems a little bit too confusing for me). On the other hand, if I need specific platform dependent path I usually create multiple build engine referring to the same jenkins server, which contains the property related to that environment, and then associating the build definition to that one. This works if you have strictly separated build definition for different environment, otherwise you can use the labels on jenkins to achieve a similar behavior.
Michele.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 03 '16, 3:29 a.m.Rob Leach
May 03 '16, 10:09 a.m.