Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Octopus, is it possible to upload a file to Octopus and then copy that to a file location in the target machine?

I want make a file(.pfx in this case) available in a target file location (ie /etc/myFolder) before a particular Octopus process step runs. Trying to use "Run a Script" step with a Bash script as my target is a Linux machine.

Is it possible to upload this file(.pfx) to Octopus and then refer that via a variable in the bash script and copy it into my target folder.

like image 981
Jagath Jayasinghe Avatar asked Nov 18 '25 05:11

Jagath Jayasinghe


1 Answers

Managed to achieve this by,

  • Adding the certificate (myCert.pfx) into Octopus>>Library>>Certificates.
  • Assigning the certificate to a Octopus project variable(var1).

And, following Bash script in "Run a script" process step did the copying of myCert.pfx content into the target location.

original=$(get_octopusvariable "var1.RawOriginal")
echo $original | base64 -d > "/etc/myFolder/myCert.pfx"

Useful links: https://octopus.com/docs/projects/variables/certificate-variables

like image 70
Jagath Jayasinghe Avatar answered Nov 21 '25 05:11

Jagath Jayasinghe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!