-
Bug
-
Resolution: Incomplete
-
Major
-
None
-
Jenkins 2.332.3
Publish Over SSH 1.24
Credentials Binding Plugin 523.vd859a_4b_122e6
When I'm using global credentials from the Credentials Binding Plugin with embedded '$', they work fine in Execute shell build steps, but get doubled to '$$' when expanded (tokenized) by Publish Over SSH in Exec Command. This doesn't seem to affect regular variables, e.g. build parameters in parameterized projects.
Steps to reproduce:
- Create credentials in Manage System > Manage Credentials as Username with password, e.g., SPRING_DATASOURCE_USERNAME and SPRING_DATASOURCE_PASSWORD. Use foo$bar as the password value.
- Create a job
- Build Environment > Use secret text(s) or file(s) = on. Add Username and password (separated) > SPRING_DATASOURCE_USERNAME and SPRING_DATASOURCE_PASSWORD.
- Add build step > Send files or execute commands over SSH. Add Transfer Set > Exec Command = echo 'SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD}' >SPRING_DATASOURCE_PASSWORD.txt
Expected: foo$bar in SPRING_DATASOURCE_PASSWORD.txt on a remote server
Actual: foo$$bar in SPRING_DATASOURCE_PASSWORD.txt on a remote server
Note:
If I use the similar command in Execute shell : echo "SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD}" >SPRING_DATASOURCE_PASSWORD.txt, the expected value is stored correctly. This flavor has to use double quotes to allow shell expansion to happen.