Interpolating env variable at build time


#1

Hey everyone,

i have encrypted our db password in b64 in order to bypass to circleci UI limitation ( it was preventing me to add the password as a variable because it contained the ` symbole ) and would like to decode it during the build, here’s the code

- run : DB_PASSWORD =$ENCODED_DB_PASSWORD | base64 --decode
 - run : echo $DB_PASSWORD

The $ENCODED_DB_PASSWORD is the original password in base64. The last command output " $DB_PASSWORD" and not the decoded version of $ENCODED_DB_PASSWORD. I lack bash skills but I’ve tried different thing ( putting it in the environment section, adding it to $BASH_ENV ) and it doesn’t seem to work. Any idea or leads?


#2

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