Using Multiple Line(newline) Environment Variables in CircleCI

In order to save an environment variable with newlines, the variable can be base64 encoded before saving and then unencoded during the CircleCI build.

cat example.txt | base64 -w 0

That value can then be copied and pasted into the CircleCI dashboard and used during a CircleCI build:

MY_UNENCODED_VALUE=$(echo $MY_ENCODED_VALUE | base64 -d)
Was this article helpful?
2 out of 3 found this helpful

Comments

0 comments

Article is closed for comments.