I am experimenting with the Tenant features on our Octopus instance (2018.4.3). One of the things that would be useful is variable octopus.deployment.tenant.tags, which is listed as a system variable. However, if I try to output that value in a test powershell script, it appears to be empty.
I have a tenant defined
My demo project is connected to the tenant
I have tenant tags defined in the library
I have a deployment target I am choosing and applying one of the defined tags from the tenant tag set I have
When I create and deploy the release, I select the tenanted deployment option, the tenant, and the tag I want to target for the deployment.
This is a script step just to verify I have access to the variables I need and the parameter Octopus.Deployment.Tenant.Name does write out to the log file in my script. The Octopus.Deployment.Tenant.Tags variable is empty even though I think I have everything wired up properly. Is there another step I am missing that would cause this to be empty?
Thanks for getting in touch! Giving this a test in my local instance seems to populate the Octopus.Deployment.Tenant.Tags variable. Is the tenant itself tagged? I believe that may be the only missing piece here. Can you confirm if this is the case (as shown in the following screenshot) and let me know how you go?
I look forward to hearing back!
You were right I did miss that step. So now I am pulling the tags for the tenant which is great. Is it also possible to get just the tags assigned to a deployment target on deployment. Lets say I have a tenant and I have tags red, blue, green, yellow. I am going to deploy a project to just a deployment target featuring the red tag. Is there a way to know in the deployment process that I am targeting just the red tag as either an OctoParameter as part of a script step or other step or other means in general?
Thanks for following up. Unfortunately there’s no system variable available to pull the individual tag(s) that are targeted at deployment time. You may be able to accomplish this by defining a prompted variable, where its value is provided at deployment time, and call this variable wherever needed. Though this would require you to type out the tag name manually to match the tag you’re deploying to, so it’s not ideal.
Sorry it’s not better news! Let me know what you think or if you have any further questions.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.