0

I have a project set up in teamcity that needs to clone a repository prior to building the project. For this, I have added a commandLine build step, and included the hg command to clone the repo in the custom script field inside teamcity, i.e hg clone http://path/to/repo/ but I get the following error, abort: http authorization required I have done some searches and i'm aware that i can include username and password with the clone command, however, the syntax for this isn't exactly clear.

Say i have a username- a and a password - b, what would be the correct syntax for running the clone command?

lacoder
  • 1,253
  • 1
  • 11
  • 22

1 Answers1

1

Your commandline should look like this:

hg clone http://a:b@host/path/to/repo/

also, to avoid displaying cleartext password/username in build logs and settings in TeamCity, consider using build parameter of password type. More details can be found in this documentation page

Nikita Skvortsov
  • 4,768
  • 24
  • 37