It's all about the answers!

Ask a question

How to hide username and password in scm command via ant script


Balamurugan Selvarasu (331430) | asked Jan 06 '15, 11:31 p.m.

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


Comments
Balamurugan Selvarasu commented Feb 19 '15, 4:33 a.m. | edited Feb 19 '15, 4:34 a.m.

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.

One answer



permanent link
Shashikant Padur (4.2k27) | 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


Register or to post 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.