Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 819
Ivan Davidov Avatar asked Sep 01 '15 11:09

Ivan Davidov


People also ask

How do you add environment to Octopus Deploy?

To create an environment, in the Octopus Web Portal, navigate to Infrastructure ➜ Environments and click ADD ENVIRONMENT. Give your new environment a meaningful name, for instance, Test, and click SAVE.

WHAT IS environment in Octopus Deploy?

Environments are how you organize your deployment targets (whether on-premises servers or cloud services) into groups that represent the different stages of your deployment pipeline, for instance, development, test, and production.

How does Octopus deployment work?

A release in Octopus, is a snapshot of the packaged software, variables, and the deployment process. A release is deployed to the environments defined in the deployment process. Typically, releases are deployed to one environment and then promoted to the next environment when they are successful.


1 Answers

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.

like image 75
Erti-Chris Eelmaa Avatar answered Oct 14 '22 12:10

Erti-Chris Eelmaa