City git push team hanging assembly

I have a problem with Team City 8.0.3 (build 27540) that hangs during the secondary build phase, which pushes changes to the remote repository. I can’t find any information that gives me an idea of ​​what happened.

VCS is configured through SSH using the default private key, and the verification mode is set automatically on the agent.

The source is verified in "repositoryPath" through the validation rule.

At the build stage, git commands from the repositoryPath working directory are run.

Here is the build log from the second step executing commit:

Step 2/2: Commit dlls (Command Line) (running for 1m:09s) [16:46:51][Step 2/2] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script5045114249582743499.cmd [16:46:51][Step 2/2] in directory: C:\TeamCity\buildAgent\work\8df15579b05cdb68\repositoryPath [16:46:51][Step 2/2] [master 9fa24ba] Teamcity update [16:46:51][Step 2/2] 1 file changed, 0 insertions(+), 0 deletions(-) *** HANGS HERE *** 

Here is the git command line step:

 "%env.TEAMCITY_GIT_PATH%" add . "%env.TEAMCITY_GIT_PATH%" commit -m "Teamcity update" "%env.TEAMCITY_GIT_PATH%" push 

If I go to the Team City working directory, I noticed that the commit was completed, but was not pressed. If I try to execute git push , it will shut down without any problems.

I would be happy to provide further details if this helps.

+4
source share
3 answers

TeamCity uses cmd.exe to run your git commands. As fooobar.com/questions/1498088 / ... says git relies on a shell script that is not available inside cmd.

Try calling msysgit bash to execute a bash script with the required git commands.

+6
source

As you can see from the above comment, the main reason is probably git password request, which is never provided by TeamCity.

Try setting up git so that it does not ask for a password (for example, set ssh keys / use wincred / git-credential-winstore ).

Or if you use GitHub and gladly put your password in the url ( as indicated in this post ):

 git push https://username: password@github.com /username/repository.git 
+2
source

I had this problem, but since I used SSH, I could not specify the username and password in the command. I knew the assembly was hanging because it was waiting for a user invitation.

I noticed that even if I had a HOME system environment variable set where the .ssh folder was, it was not on the SET list when TeamCity ran the git push command.

Therefore, I changed the script variable to reset HOME:

 SET HOME=D:\ git push 

... where D: \ is the .ssh folder containing the public / private keys.

+1
source

Source: https://habr.com/ru/post/1498087/


All Articles