How do I prompt for username and password in ant script HCO command connecting to Harvest?

bprasana's picture
bprasana asked on May 10, 2012 - 5:48pm | Replies (5).

I am looking for a solution where the password and userid to connect to Harvest is prompted at command line in the ant script without hardcoding it in the script.

Do you know how to do that?

I tried the -prompt option, that did not solve my problem entirely. Although the ant stops for prompt, I had to interrupt the script with CTRL+Z to get the PASSWORD: prompt.

5 Answers

Tim Betzler's picture

Hello,

Preferrably you should not have to do that. You could use the encrypted dfo files to do this. Refer to the Reference Guide HCO command with the -eh parameter. This will allow you to create DFO files to connect to CA SCM. Refer to the svrenc command to create dfo files.

-prompt over-rides -usr -pw and forces interactiviy. If you want the user/pass in the command line, then use -usr -pw without -prompt.

Regards,
Tim

bprasana's picture
bprasana replied on May 11, 2012 - 12:21am.

Hi Tim,
My userid is tied to active directory which has a password change policy of 90 days. I don't want to create encrypted files every 90 days.

I tried with -prompt option, and any script stops processing at the prompt but does not take any input from user unless I try to kill the script.Only then I can see a the word PASSWORD:, but since I have already killed the script it doesn't make sense.

BTW, are you the same Tim who wrote white paper on using hco command in ant?

Tim Betzler's picture

Nope, not the same Tim :)

Is there a way you can get an ID that you would not need to change the password on a regular basis? Additionally, you should be able to get a username / password within SCM that does not integrate with AD if you are running a Mixed Mode configuration.

Generally for Build ID's, we would create an ID similiar to an application ID, that would not need to reset the password on a regular basis. Just my 2 cents on that.

bprasana's picture
bprasana replied on May 24, 2012 - 8:52pm.

Sorry for the late reply. I am just a end user for harvest, I dont think I can get another userid. Nevertheless that will still be a quick fix(or alternate solution) rather than the actual solution for my initial problem.

Have you or anybody tried integrating Harvest with ant scripts?

Tim Betzler's picture

You should really engage your site administrator(s) of your tool. They should be aware of the integrations being performed. More than likely, they have a service account available for your use already.

If the admins don't know you're doing what you are doing, when they go through upgrades, conversions, etc they won't engage you or your processes.

What is your particular administrators preference on how to accomplish your integrations?

With regards to integrating with ANT, when you're using the command lines it doesn't really matter if you are using ANT, shell, etc; the command line utilities still have requirements of their own.

CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.