Environments per project?

Hi, first of all, congrats for this great product. We’ve been using it for a while now, and it’s great.

I have one question regarding Projects/Environments/Machines. I have this scenario and I’m not sure if it’s the right way to do it…

  • Projects: ProjectA, ProjectB.
  • Environments: DEV, QA, PROD.
  • Machines: WebServerA, WebServerB.

ProjectA deploys to WebServerA for all environments (DEV, QA, PROD). This is accomplished by setting a different Installation Directory variable scoped to the targeted environment.

But I need ProjectB to deploy to WebServerA for DEV/QA environments, and only WebServerB for PROD.

The problem is: when I launch a deployment of ProjectB on PROD, Octopus tries to do it on WebServerA and WebServerB, because both are “PROD” machines…

Do I need to name the environments for every project? I was wondering if it wouldn’t be easier to configure the environments per-project…

Hi Adrian,

Thanks for getting in touch! It looks like the easiest solution here would be to create another Production environment and add WebServerB to the new environment. You can then create a new Lifecycle with this environment and update ProjectB to use the new Lifecycle.

This will let you deploy ProjectB to Development -> QA -> NewProduction(With WebServerB)

Let me know if this help or if you have any further question here. :slight_smile:

Best regards,

Hi Daniel, thanks for your fast reply!

I’m trying your solution and seems to work very well, but looks more like a workaround for me. In order to get things clean, I’ll end up creating custom environments for every project, like ProjectADev, ProjectAQA, ProjectBDev, etc…

I don’t know if it’s very common to “share” the same environment across many projects, even when an environment possibly holds multiple servers (a farm for example). At least in my case, “Prod” for a project may involve a very different set of machines than “Prod” for another project.

Perhaps you may consider adding such functionality for a future release…

Thanks again for your support!

Hi Adrian,

Thanks for getting back. I’m glad that you have this working for you, using my solution or your own. (If it works, that’s great!)

Ill pass your thoughts/comments onto our developers to have a look at. However, generally we go through UserVoice for suggestions from the community. I’ll paste a link below in case you are interested in having a look through or creating your own suggestion.

Let us know if you have any further questions or perhaps run into any issues… :slight_smile:

Best regards,

Daniel, thanks for your help. I solved the issue by creating a custom environment per project as you suggested, like “NewProduction”.
I’m going to take a look at UserVoice and suggest what we’ve been discussing.


Hi Adrian,

No worries, feel free to get in touch at any time.

Best regards,