Library variable sets accessible from Shell script

Is there a way of accessing Library variable sets of octopus in Shell script that we configured in a step of deploymentprocess section?

Hi @pdur,

Thanks for reaching out. Is the library variable set included in the project you’re running? If so you should just be able to reference the variable in your bash script. Here is some example code on how to apply this: Using Variables in Scripts

If you are trying to reference a library variable set that isn’t included in your project, you will need to utilize API calls to get that information. We don’t have many Bash examples to link you to, but here is a PowerShell script that has an example of how to hook into a library variable set and do things with it. MigrateVariableSetVariablesToProject.ps1

You could just use the same logic in bash to hook into a library variable set, then iterate through the variable set matching by name, then output the variable.

Please let me know if this works for you or if you need more assistance with it.

Thanks,
Jeremy

1 Like

Sorry. I forgot to write earlier but your suggestion worked.
Thanks.

1 Like

Hi,

Thanks for letting me know, I appreciate it. I’m glad you got it going.

Have a great week.

Thanks,
Jeremy

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.