How to create a build only from new or modified files in a workspace or Stream since a specific date?
2 answers
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
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
Thanks Andy!
Can you please point me towards some documentation on ' -j option to the compare command'?
-Chkvirgo
Comments
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!
Thanks Andy
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??
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. ..