Cannot use $$ character in environment variables of GitLab CI.
I store my secrects in GitLab CI environment variables out of which one of my pass word string has $$ characters at the end (eg :Ab1ab$$). When i echo it out or use envsubst, the output will be Ab1ab$, stripping the extra $ on the end.
I tried using to surround the string in '',"" none of which helped. Saw some concerns on the gitlab community regarding the usage of $ character in the env variables, but could not find any workarounds for my exact problem.
https://gitlab.com/gitlab-org/gitlab-ce/issues/27436
export VAR= 'Ab1ab$$' echo $VAR=Ab1ab$
This is a pretty common problem with setting env variables in CI! I have encountered it numerous times with CircleCI as well. I have found great success with backslashes, typically, but I'm guessing you tried that already.
I found a thread discussing what I believe is likely a deeply related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/27436
Key takeaway there is that at least in that version of the GitLab product they hadn't found a great answer yet. I decided to start doing some experimentation:
https://gitlab.com/mattbornski/gitlab-ci-exploration
I set up a whole bunch of environment variables in different formats to see which resulted in a dollar sign.
So, takeaway here:
So your options look like:
For further exploration, here are a bunch more fun options to try: https://unix.stackexchange.com/a/309791