I've got a git repository setup (using gitblit), Jenkins and Team Foundation Server (TFS). What I am trying to do is:
1) Have engineers submit code into the git repository.
2) Jenkins will compile the code.
3) Jenkins will add the code changes into TFS.
Pretty simple right? Well I am running into an issue with reflecting deleted files in TFS. What I have working is as follows:
1) Jenkins runs a script that deletes all of the files and folders in the Jenkins workspace
2) Jenkins then clones files from the git repo to the Jenkins workspace.
git clone git://devfilesrepo.company.com/DevFiles.git %WORKSPACE%
3) Jenkins executes a batch file that has the following TFS commands:
set checkinComment=%1
tf workfold /collection:http://faketfs:8080/faketfs/DefaultCollection /workspace:DevFiles /map $/Dev/DevFiles "C:\Jenkins\jobs\DevFiles\workspace" /login:Company\admin,fakePass
tf checkout "C:\Jenkins\jobs\DevFiles\workspace" /noprompt /recursive /login:Company\admin,fakePass
tf add "C:\Jenkins\jobs\DevFiles\workspace" /noprompt /recursive /login:Company\admin,fakePass
tf resolve /auto:KeepYours /noprompt /recursive /login:Company\admin,fakePass
tf checkin /comment:%checkinComment% /noprompt /recursive /login:Company\admin,fakePass
Now the above commands work great if a file is added or edited when it goes into Git. However, if a file is ever deleted from Git, it is not reflected in TFS.
To make the situation even more complicated. I also need to add a couple of files to TFS that should not exist in the Git repo.
Is there a TFS command I could run that would reflect the deleted changes?
I was thinking of deleting the TFS folder before adding files from Git, but then I would also be deleting the files that I added to TFS directly. I heard about Git-TF and Git-TFS, would those utilities be able to do what I am looking for? If so, what commands could I run to get the code from Git over to TFS?
Thanks