It's all about the answers!

Ask a question

Components still loaded when excluding components in jenkins pipeline using rtc checkout scm.


JOSEPH MURO (1111) | asked Jan 29 '19, 6:54 p.m.
retagged Feb 04 '19, 3:27 p.m. by Michael Afshar (7014)

I am using jenkins RTC integration. I have an RTC build definition mapped to a jenkins job. I need to exclude certain components from being loaded. I have the following coded in a jenkins pipeline:


checkout([
    $class: 'RTCScm', 
    buildTool: 'rtcBuildToolkit', 
    buildType: [ 
         buildDefinition: 'my-personal-build',
         value: 'buildDefinition',
         loadPolicy: 'useComponentLoadConfig',
         componentLoadConfig: 'excludeSomeComponents',
         componentsToExclude: 'comp_a,comp_b'
    ],
    acceptBeforeLoad: false,
    clearLoadDirectory: true,
    changelog: true,
    credentialsId: 'mycreds',
    overrideGlobal: true,
    avoidUsingToolkit: false,
    serverURI: 'https://my.jazz.repo.com', 
    timeout: 480
])
The result is that comp_a and comp_b are not excluded (i.e. still loaded). What am I doing wrong here? I used the instructions outlined here: 

One answer



permanent link
Sridevi Sangaiah (59179) | answered Jan 29 '19, 11:41 p.m.
JAZZ DEVELOPER
When a Jenkins job is associated with an RTC build definition then any Jazz source control related configurations like repository workspace, load directory, list of components to exclude, etc. are read from the RTC build definition and not the Jenkins job. List of components to exclude can be specified in the RTC build definition like mentioned in point#12 here - https://jazz.net/help-dev/clm/index.jsp?topic=%2Fcom.ibm.team.build.doc%2Ftopics%2Ftcreatebuilddefinition.html

Comments
JOSEPH MURO commented Feb 05 '19, 10:37 a.m.

Thank you for your response Sridevi. So you are saying that the checkout step in my jenkins file is a no-op?  What if I create a build definition that skips the RTC source code step and invokes jenkins....will the checkout step be performed in that case?


A related question, I see the RTC provides a mechanism for excluding components, but in my case, my stream has many components ( > 50), so I don't want to manually list out each excluded component. I want to tell RTC to only include the one or two components that I care about. Is that possible?


Sridevi Sangaiah commented Feb 06 '19, 12:13 a.m. | edited Feb 06 '19, 12:14 a.m.
JAZZ DEVELOPER
Please find my comments inline.

>>So you are saying that the checkout step in my jenkins file is a no-op?
Not exactly. Checkout would still happen but the details required for checkout like build workspace, load directory, etc. would be read from the Jazz Source Control configuration included in the RTC build definition.

>>What if I create a build definition that skips the RTC source code step and invokes jenkins....will the checkout step be performed in that case?
I believe that the Jenkins checkout would fail with "Build definition <Build_Definition_id> is not configured for Jazz SCM"

>>I want to tell RTC to only include the one or two components that I care about. Is that possible?
If you are using 605 or later version of RTC then you could use load rules to specify the list of components to load. https://jazz.net/library/article/1015 provides more information on how to create/generate load rules.

Your answer


Register or to post your answer.