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:
"Value": "First Service",
"Description": "Select the relevant service",
"Octopus.SelectOptions": "service-1|First Service\nservice-2|Second Service\nservice-3|Third Service"
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
- 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!