Hey @tirelibirefe , thanks for reaching out!
Dynamic drop down values are definitely something that comes up in different deployment contexts. Generally, the way we’d recommend approaching it is creating a runbook that can call out for the needed values and then perform an API call to your Octopus instance to update the prompted variable values for your deployment process.
While we don’t have a great native Bash example of a script like this, but you can see a PowerShell/C#/Python/Golang example in our documentation here.
The biggest difference you’ll find is that prompted variables have a slightly different object shape - here’s an example from a local variable in my instance:
{
"Id": "eabd2d60-286f-6f7f-3449-66f22891032d",
"Name": "DropDown",
"Value": "First Service",
"Description": null,
"Scope": {},
"IsEditable": true,
"Prompt": {
"Label": "ServiceSelector",
"Description": "Select the relevant service",
"Required": true,
"DisplaySettings": {
"Octopus.ControlType": "Select",
"Octopus.SelectOptions": "service-1|First Service\nservice-2|Second Service\nservice-3|Third Service"
}
},
"Type": "String",
"IsSensitive": false
}
In the above object, Value
is the default value for the drop down (optional). The important changes are under the Prompt
object, where you’ll see matches for the UI elements in your screenshot. The Prompt.DisplaySettings[Octopus.ControlType]
will be Select
for drop down lists, and the Prompt.DisplaySettings[Octopus.SelectOptions]
will be your drop down items, formatted as Value1|Display text 1\nValue2|Display text 2
. The newline characters (\n
) will be appropriately interpereted when it’s in the Octopus UI.
Put all together, a process like:
- ECR command to get the image list
- Format into
value|display
string
- Modify variable set via API call to update the values
Should work as a scheduled runbook to keep your drop down values in sync. Please let me know if you have any questions or concerns, happy to help!