Hi,
in my company we are currently evaluating Final Builder to use it on our automated build process. So far what we have found is very nice, but we have some doubts about how to do some things.
Our scenario is following:
We need FB to iterate folders that will contain subfolders that will contain SQL scripts and Oracle packages. All of these scripts and packages will have a SVN status, some modified (e.g. not committed) and some updated. FB should be able to distinguish them and execute only the modified ones.
Questions regarding this scenario are:
1- We have put a Folder Iterator and set Recurse to true, but it only iterates the list of folders inside the base folder and does not move into them. We have seen in the help something about setting the Iterator variable to CurrentFolder but can not find it. (?)
2- How can we tell if a file is modified or updated? We have seen the SVN status action but are not sure how to check it. Using an if condition? If yes, how?
3- We understand the correct way to iterate all files inside a folder would be to add a child File Iterator action to the Folder Iterator. Is that correct?
4- Supposing we can iterate all folders and files inside them, how do we assign the files to the ADO Execute action so that it executes them?
Thanks in advance and best regards
Hi Guillem,
You can use a FileSet and the FileSet iterator to iterate over all the SQL and Oracle files within a directory structure. Once you have the list of files, you’ll need to use the Subversion Status action to check the status of each file, the easiest way to do this is to set the action to fail when the file is modified and then use the If Prev Action Failed action.
To use the contents of the files within an action, you can either use the ‘SQL Statement from File’ option on the ADO Execute SQL property page, or you can read the contents of the file into a variable using the Read Text File action and then reference the variable in the action using the variable syntax, %Var_Name%.
Regards,
Paul.
Hi Paul,
ok, I managed to correctly create the FileSet and I have used the FileSet iterator to iterate through all the files. I have also added a Subversion Status action and an If Prev Action Failed action, but I have some problems with the first one.
I am guessing I need to set the Path of the Subversion Status to the file that failed but I am not sure about how to do that. Do I need to do this via a script? Or is there another way?
Thanks for your help and best regards
Hi Guillem,
I've attached an example project which uses the Subversion Status action to determine whether a file has been modified. You'll need to modify the paths and the FileSet for it to work for your repository.
Regards,
Paul.
SubversionStatus.fbz6 (2.776 KB)
Hi Paul,
first of all sorry for answering so late. I had to do some critical work for a client and could not continue with the evaluation. Also thanks for your project, it has clarified a lot of doubts we had. I can now successfully iterate over all the folders and detect if some file has been changed.
I still have problems with added files, though. Not sure why but it does not detect them. I have set the “Fail Action If” of a Subversion Status task to “Total Items Added Greater than 0” and I can see FB is issuing following command:
Parameters: status --non-interactive --show-updates FileName
I am guessing this is the correct one, but it returns total items added = 0. Ever seen this before?
By the way, I have a local SVN and a remote SVN. The added file is so on the remote server. Can it be that somehow this is confusing FB?
Thanks and best regards