It's all about the answers!

Ask a question

How to create a build only from new or modified files in a workspace or Stream since a specific date?


chkvirgo Kris (122) | asked Jan 06 '14, 12:24 p.m.
 How to create a build only from new or modified files in a workspace or Stream since a specific date?   


We would like to deploy only files that were modified or files that were added to a workspace or stream since last build request.

Is it possible?

2 answers



permanent link
Andy Jewell (24236374) | answered Jan 06 '14, 12:55 p.m.
I think the general approach is to use the compare command to generate your list of changes.  In our case, we use the auto-generated snapshot (the snapshot created by our Jenkins process) and compare that to the target stream (the workflow target).  If you use the -j option to the compare command, you get output that is very easy to parse programmatically.  At that point, just copy the items that you want (i.e., those that show up as differences in your stream) and process them accordingly.


- Andy

Comments
Spencer Murata commented Jan 06 '14, 1:21 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

To add on, you tagged this as BF too.  In BF you can use a .date command in the environment to generate a date variable when the build runs, then you can .set that variable back to some variable like LAST_RUN, and then compare during the build process to determine if a build is necessary since some given date.


~Spencer


permanent link
chkvirgo Kris (122) | answered Jan 06 '14, 1:25 p.m.
 Thanks Andy!

Can you please point me towards some documentation on ' -j option to the compare command'?


-Chkvirgo

Comments
Andy Jewell commented Jan 06 '14, 1:30 p.m. | edited Jan 06 '14, 1:31 p.m.

Using the lscm command, just do:


lscm help compare

For example, the command I use is:

lscm compare -r local -I "dcfw" ws "build workspace" stream target_stream -j

To get the json output, you just add the -j option to most any of the lscm commands.  If you are not familiar with lscm, you probably want to play with it a little bit.  Check out this article.  Good luck!


chkvirgo Kris commented Jan 06 '14, 1:53 p.m.

Thanks Andy 


chkvirgo Kris commented Jan 07 '14, 2:01 p.m.

I tried compare command below:


lscm compare -r local -u userid -P password workspace "wrkspc" stream target_stream -p c


Is -p c supposed to remove unchanged/empty items in wrkspc component??


Andy Jewell commented Jan 23 '14, 5:44 p.m.

Sorry, @chkvirgo, didn't realize this thread was still going on.  I haven't used prune but yes, I think you would expect that to remove unchanged componented.  If it's not working you might try putting it in quotes (-p "c").  Just an idea. .. 

Your answer


Register or 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.