How to hide username and password in scm command via ant script
Hello All, I have created a ant script for creating snapshot baselines in RTC. I don't want to show the username and password parameters. Is anyone aware it can be achieved?
Thanks in advance. Regards, BalaMurugan S |
One answer
Shashikant Padur (4.3k●2●7)
| answered Jan 07 '15, 5:51 a.m.
JAZZ DEVELOPER edited Jan 07 '15, 5:52 a.m.
In the machine where you are running the ant script, run 'scm login' command in the terminal. This will create a configuration directory in the users <home directory>/.jazz-scm. If you look under the .jazz-scm directory, you will find a file called repositories.txt that has the encrypted password.
Any command (or script) that runs against the repository that was cached (after login) will use that credentials to contact the repository.
If you want change the configuration directory, you can provide the --config option to the scm tool. For ex: scm --config <some location> login ...
From then on all the commands should use scm --config <location> <command> .... to use the credentials cached in that location or set the env var SCM_CONFIG_DIRECTORY to that location and run the commands as usual without the --config option.
Note: The password caching provides a convenient way to run commands without specifying the username and password on every invocation of the command. Although the password is encrypted it should be cached in a secure location.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
In an ant script you can pass through the password while executing the script.
You can use input tag for reading the input and parsing through the script where ever password variable declared in the script.