Always deploy to specific targets

Is there any plan to have a project always deploy to a specific target? Currently, I have to go into the advanced options and select the server from the “Release” environment. Currently running Octopus 3.1.4.

Hi Andrew,

Are you saying you only want to deploy to a subset of machines within an environment?

Could you achieve your goal with machine-roles?


So, we have three servers hooked up right now and two environments.

Environment: Development

Environment: Release

Right now, we have all the servers assigned as “web-server” roles. In one project, we have a step to “Deploy Web App” that takes the nuget package and deploys its to all the machines in the roles “web-server” only in Development and Release.

Would you recommend assigning a different role to one of the release servers and instead of having one “Deploy Web App” step there would be two steps that would be “Deploy Web App” in web-server roles for Development and then “Deploy Web App” in [new server role] for Release?

Hopefully that makes sense, just trying to figure out the best practice for this scenario.


I’m sorry, but I still don’t think I understand your scenario. Do you sometimes not want to execute the ‘Deploy Web App’ step for both servers in the Release environment?

In the meantime, I’ll just outline the general behavior. Apologies if I’m telling you things you already know :slight_smile:

When you create a deployment for a release, you select an environment.

The deployment iterates over each machine in that environment. For each machine, any steps with matching roles are executed. Unless the step specifies one or more environments in the “Environments” field, and the current environment is not one of them.

So in your situation, if give all your machines the “web-server” role, and simply have the one “Deploy Web App” step that targets the “web-server” role and leaves the “Environments” field empty, when you deploy to the “Development” environment the step will execute for DevServer01. When you then promote the release to the “Release” environment, the step will execute for “ReleaseServer01” and “ReleaseServer02”. Does your desired behavior differ from this?