I’m trying to template a configuration file on linux. From what I can find on the documentation, this must be accomplished through a script (we’re deploying an archive to a linux system). With that in mind, I added a custom post-deploy script shown below. This works to template the file only if I remove the $(get_octopusvariable "app_key")
variable substitution. As soon as I add the variable substitution, I get bad decrypt errors. The endpoint is an ssh target. What is causing there errors? Is there a better way to template arbitrary files if you’re not using Nuget packages? That would be a nice feature as OD moves further into cross platform.
Octopus Version: 3.5.2
Deployment Target OS: Centos 7
Variables:
app_key -> base64:+oP1Az/MeQsBMV5JOQONK5ICheVKdRGpCo3o76ved3A=
Post Deploy Script:
#!/bin/bash
cat > /var/www/html/website_root/.env << EOF
APP_ENV=local
APP_DEBUG=true
APP_KEY=$(get_octopusvariable “app_key”)
DB_HOST=localhost
DB_DATABASE=database
DB_USERNAME=user
DB_PASSWORD=password
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
LDAP_PASSWORD_RESET.DEV.USERNAME=
LDAP_PASSWORD_RESET.DEV.PASSWORD=
LDAP_PASSWORD_RESET.TEST.USERNAME=
LDAP_PASSWORD_RESET.TEST.PASSWORD=
LDAP_PASSWORD_RESET.PROD.USERNAME=
LDAP_PASSWORD_RESET.PROD.PASSWORD=
EOF
ServerTasks-55986.log.txt (6 KB)