Friday, 15 January 2010

iis 7 - Better alternative to batch file for automatic Git-Pull on windows server -


I have a set of web servers, and to keep the file up to date on the server, I use a window scheduled task I am doing The task is called a batch file which executes the GIT-pull command.

It seems quite simple, but I use the SSH key to authenticate the git server. So far, the only way I am able to understand these keys in GIT is to pass Pageant.exe As a result, my batch file contains the following commands:

  "C: \ Program Files \ TortoiseGit \ bin \ pageant.exe" "C: \ PrivateKey.ppk "Set local set HOME = C: \ set GIT_SSH = C: \ Program Files \ TortoiseGit \ bin \ TortoisePLink.exe cd c: \ webserverfiles git pull -v --progress main master   

this much more Works for Shash Part; However, one major issue is that the pagnet runs in the background, and on the first execution of this batch file, the first line hangs indefinitely to work around this, I manually run the task, kill it , Then let it run automatically later. However, if the pager crash or the server reboots, my files no longer synchronize on that server because the first-line problem (which could be a major problem in the round robin scenario).

Are there any suggestions on how to improve this plan? I can not go to https-based git.

I do not recognize the condition that you have to make special environment settings for working the guit command. Are you sure you have installed it correctly?

  • I usually recommend that developers
    1. install
    2. install.
    3. When installing the Tortoise Git, they should choose OpenSSH (not TortoiseGitPLink). Enter image details here
    4. Run ssh-keygen.exe-C " To generate a key in the firstname $ HOME \ .ssh folder, .lastname@ domain.com "
    5. enter the public key in the .ssh \ id_rsa.pub Copy in

      is required. (SSH_AGENT_PID and SSH_AUTH_SOCK variables are set by framework) git clone ssh: // xxxx should work now.

  • No comments:

    Post a Comment