Variables

ersimpso's Avatar

ersimpso

17 Jul, 2017 07:46 PM

Is is possible to print out all the variables configured in Octopusdeploy? If not are the variables stored in a file that is accessable?

Thanks

  1. Support Staff 1 Posted by Kenneth Bates on 18 Jul, 2017 04:03 AM

    Kenneth Bates's Avatar

    Hi,

    Thanks for getting in touch! Octopus variables aren't stored in any file. As there are different kinds of variables (system variables, library variable sets, project variables), which variables are you wanting to retrieve? Knowing a bit more about your requirements and what you're after will help us come to the best solution. :)

    I look forward to hearing back!

    Best regards,

    Kenny

  2. 2 Posted by ersimpso on 18 Jul, 2017 01:35 PM

    ersimpso's Avatar

    Hi
    Actually I would like to gather an editable list of all the variables for the purpose of documentation and further review of additions or simplification of the variables we use.

    Regards, Ed

  3. Support Staff 3 Posted by Kenneth Bates on 19 Jul, 2017 05:13 AM

    Kenneth Bates's Avatar

    Hi Ed,

    Thanks for following up. Unfortunately we don't have any built-in way to collect and print all variables. Since there are different kinds of variables, which are stored separately, this would need to be done manually for each location in which we store the variables. This would be for each project, library variable set, tenant variables, etc.

    Via the API, you could do something like:

    • get all projects, order alphabetically
    • print out name of the project
    • print out all of its variables

    Then do something similar for your variable sets, and tenant variables. You'd also need to make sure you're logged in as a user with access to all things you could scope these variables to.

    We have some example API scripts available in our API repository here which may help provide a good starting point.
    https://github.com/OctopusDeploy/OctopusDeploy-Api/tree/master/REST...

    Sorry it's not better news. Let me know if you have any further questions at all.

    Best regards,

    Kenny

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac