Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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: 

0 votes



One answer

Permanent link
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

1 vote

Comments

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?

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 log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 7,495
× 1,381
× 1,220
× 382
× 151
× 57

Question asked: Jan 29 '19, 6:54 p.m.

Question was seen: 3,853 times

Last updated: Feb 06 '19, 12:14 a.m.

Confirmation Cancel Confirm