Reference PackageVersion from inline bash script

I would like to reference octopus system variables like Octopus.Action.Package.PackageVersion from an inline bash script without needing to pass it as a parameter. I might be missing something obvious, but it seems like there is only documentation for doing this in PowerShell (https://octopus.com/docs/deployment-examples/custom-scripts#Customscripts-Passingparameterstoscripts)

Is there a way to do the equivalent of

$environment = $OctopusParameters["Octopus.Environment.Name"]
Write-Host "Environment: $environment"

in an inline bash script?

Hi Philip,

Thanks for getting in touch! Referencing system variables in a bash script in the same way as the PowerShell example you referenced should have the following syntax:

environment = $(get_octopusvariable "Octopus.Environment.Name")
echo "$environment"

I hope this helps! Let me know how you go or if you have any further questions moving forward. :slight_smile:

Best regards,

Kenny

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