How to pass octopus variables inside the file on target

I have linux target and one of my steps is to overwrite one of the files on this target.
The problem is that i dont get the variables in the end file, i get the text.
For example instead of this -
I got this -
Here is my bash script:

cat > /home/docker/docker-env/octopus-deployment.env <<- "EOF"
export AWS_DEFAULT_REGION=$(get_octopusvariable "AWS_DEFAULT_REGION")
export AUTH_TOKEN=$(get_octopusvariable "AUTH_TOKEN")
export SYSTEM_EMAIL_ADDRESS=$(get_octopusvariable "SYSTEM_EMAIL_ADDRESS")
export AWS_SECRET_ACCESS_KEY=$(get_octopusvariable "AWS_SECRET_ACCESS_KEY")
export AWS_ACCESS_KEY_ID=$(get_octopusvariable "AWS_ACCESS_KEY_ID")

Is there any way to pass Octopus variables inside the file on remote target?
Thank you.

Hi @andreybyhalenko,

Thanks for reaching out to us today and welcome.

Octopus has the ability to change a file and replace values with variables. We have some documentation on this.

Hopefully this helps, but feel free to reach out if there is anything else we can assist with.

Kind Regards,


1 Like

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