0

We have libraries in Visual Studio and bamboo, that get changed more often. We want our weekly build to find that library (say it is version 2.3), but in bamboo we have that library being built and deployed at 2.4. Which of course is stored in the packages.config file.

I am sure there is some way to do it, that others have wanted to do this, but I can't find exactly something that spells it out (or I am reading into things too much or too little).

How through bamboo, would we go into this and change before the build?

Is it a third party tool? Recommendations?

Is there some script that is done?

Is there some tool within bamboo that handles this?

Greg P
  • 772
  • 2
  • 10
  • 23
  • You mean find/replace all occurences of some string like `id="mypackage" version="2.x.x" ` in all packages.config files before the build? Powershell comes to mind, eg https://stackoverflow.com/questions/2837785/powershell-script-to-find-and-replace-for-all-files-with-a-specific-extension – stijn Aug 16 '17 at 18:37
  • So you would use powershell to go through all projects in stash/bitbucket or bamboo to update all references to the values before running the build? I can see how powershell you could do that say on my pc, but how would you do it against stash/bitbucket or bamboo? But yes, that is the general idea. – Greg P Aug 16 '17 at 18:40
  • 1
    Never used Bamboo, but if it's like any other build server it basically first clones all code to disk in (likely in a virtualized environment but that doesn't matter), then starts running build steps. And usually these build steps can be either msbuild or command-line based or script based or ..., Powershell should be no problem. So in your first step you can modify files at will, in this case something like `ls -Recurse packages.config | DoFindReplaceVersion` ran from in the parent directory where all projects are – stijn Aug 16 '17 at 19:02
  • Will check this out. Seems I can associate a powershell file with the build...so as long as I can refer to the dll's and I, I could probably do this. – Greg P Aug 16 '17 at 19:04
  • just a note: It doesn't have to be Powershell, if you're more confident using Python or sed or whatever, just use that (if Bamboo's environment has it) – stijn Aug 16 '17 at 19:08
  • I am more comfortable with powershell, but thanks for the note. – Greg P Aug 16 '17 at 19:08

0 Answers0