Problem: Our CI server needs to grab the source code from external world to run a build.
Use git behind firewall
git config –global -l
git config -global http.proxy=http://proxy-server:port-number
If reset is necessary,
git config –global unset http.proxy
or git config –global unset-all http.proxy
Configure TeamCity connect to external git repository
So far there is no place to set http proxy in teamcity yet. (we are on teamcity 7.03）
One easiest solution is:
- git clone to local repo folder, e.g. c:/git_repo>git clone https://remote-git myrepo
- share this folder on local network
- in TeamCity, VCS settings, set remote fetch url to \\repo-host\myrepo
- tahdah…it works!
Remaining problem is we still need to manually run git pull on git_repo folder to get latest from remote, maybe a cron job can make this easier.