Ivan Davidov
Ivan Davidov

Reputation: 823

How to octopus deploy different versions of the dependent assembly in different environments

We have a project that can use two different versions of the certain DLL. We need this deployed in two different environments. Which version of the DLL is being used should depend on the environment.

One suggested solution is to copy the entire code-base and to create octopus deployment configurations based on those two code-bases.

I am strongly against this, but still don't have the solution to the problem.

I think that binary redirection won't work because I cannot specify the dll path in the config, and of course, I can't have those two files in the same directory.

Any ideas ?

Upvotes: 11

Views: 619

Answers (1)

Erti-Chris Eelmaa
Erti-Chris Eelmaa

Reputation: 26268

It could be easily solved by powershell script, as an Octopus deploy step. For example, your project could have two files:

YourFile.dll
YourFile.v2.dll

Then your powershell script, post-step, (pseudocode) will look something similiar:

if($OctopusParameters["environment"] == "Dev") {
   File.Delete("YourFile.dll");
   File.Rename("YourFile.v2.dll", "YourFile.dll");
}

I agree though that this is quite unusual problem, and might indicate code smell.

Upvotes: 2

Related Questions