Hi,
I am using gitlab ci to ftp on final build where git setup not possible. Seems working well with using setting up username and password in variable and using those variables in git-lab.yml file. Recently, I have face issue with one of our project where password contain $ sign. I can't found any way to escape it. I have tried to put \ before $ sign but doesn't work. I think variable already considered as escaped text.
How can I escape $ in varilable value?
Designs
An error occurred while loading designs. Please try again.
Child items
0
Show closed items
GraphQL error: The resource that you are attempting to access does not exist or you don't have permission to perform this action
No child items are currently open.
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
@thecfguy What about using quotes? By the way, I think that using secure variables to store passwords may be a better idea than to put it inside .gitlab-ci.yml. Feel free to reopen this issue if this doesn't work for you!
@grzesiek I think, I have confused you. I mean to say issue I am facing with variable and issue only happen if my password contains $ sign. Below is log of runner and you will notice that password is showing 8 characters long but in real value stored in variable FTPPASS (F#3BfQ!$bFS5d#) is quite long.
PS: I have change actual password and masked some text in below log
gitlab-ci-multi-runner 1.1.0 (a23a25a)Using Shell executor...Running on lamp...Fetching changes...HEAD is now at ca5f28f moved project to gitlabFrom http://gitlab.com.local:81/xxxx/xxxx ca5f28f..23183fc master -> origin/masterChecking out 23183fca as master...Previous HEAD position was ca5f28f... moved project to gitlabHEAD is now at 23183fc... adding verbous tag$ git ftp push --disable-epsv -vv -u $USER -p $FTPPASS ftp://ftp.xxxxx.com/Mon Apr 25 05:58:36 UTC 2016: Disabling EPSV.Mon Apr 25 05:58:36 UTC 2016: Host is 'ftp.xxxx.com'.Mon Apr 25 05:58:36 UTC 2016: User is 'xxxx-users'.Mon Apr 25 05:58:36 UTC 2016: Password is set.Mon Apr 25 05:58:36 UTC 2016: Path is ''.Mon Apr 25 05:58:36 UTC 2016: Syncroot is ''.Mon Apr 25 05:58:36 UTC 2016: CACert is ''.Mon Apr 25 05:58:36 UTC 2016: Insecure is ''.Mon Apr 25 05:58:36 UTC 2016: Retrieving last commit from ftp://ftp.xxxx.com/.* Hostname was NOT found in DNS cache* Trying xx.xx.xx.xx...* Connected to ftp.xxxx.com (xx.xx.xx.xx) port xx< 220 Please visit https://filezilla-project.org/> USER xxxxxxx< 331 Password required for xxxxxxx> PASS F#3BfQ!#< 530 Login or password incorrect!* Access denied: 530* Closing connection 0
Here are variables, that I defined in my test project (on project's Secure Variables page at GitLab.com):
AAA=aaaBBB=bbb$AAACCC=ccc\$AAA
This is how variables are send to the GitLab Runner: AAA=aaa BBB=bbb$AAA CCC=ccc\$AAA. So GitLab CE/EE is sending variables just as they are created.
This is how variables are stored just before the line I've linked above: AAA=aaa BBB=bbb$AAA CCC=ccc\$AAA. So nothing changed.
And this is how variables are returned by the Expand method: AAA=aaa BBB=bbbaaa CCC=ccc\aaa. So it looks like the Expand method is expanding variables in some strange way with improper escaping.
I think that it shouldn't work like this. Let's move this issue to the Runner's project and think how to repair this.