Setup git access on TeamCity behind firewall

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
check http.proxy=?

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:

  1. git clone to local repo folder, e.g. c:/git_repo>git clone https://remote-git myrepo
  2. share this folder on local network
  3. in TeamCity, VCS settings, set remote fetch url to \\repo-host\myrepo
  4. 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.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s