When you create a deployment target in Octopus Deploy it has to be assigned to at least one role. What does a “role” mean? How do they work in Octopus Deploy?
You need to be able to tell Octopus Deploy where to deploy code. However, you cannot use machine name, as that will (most likely) be different for each environment. Roles allow you to define the server you want to deploy. In this image below, the deployment will occur on any server with the role
When a deployment occurs Octopus will find all the servers with that role in that specific environment. In this case, when I deploy to Dev it will find two servers.
The role name itself is very important. If at all possible, do not use generic role names such as
App-Server in your deployment process. We recommend
[App]-[Component] such as
OctoFx-RateService. This will give you more control and flexibility. If your process is deploying to
IIS-Server and you want to have a separate server for that specific app then you’d have create a unique role and then go into the deployment process and update it.
A deployment target can be assigned to 1 to N roles.
However, don’t include the environment name in the role, such as
OctoFx-Web-Prod. That will lead to unnecessary steps added into your process and more maintenance than necessary.