Önceki yazımda basit bir git deposu oluşturmayı göstermiştim.
bu kez gelen ilgili yazıya gelen istek üzerine gitweb yani git web arayüzü üzerinden projelerinizi paylaşmayı gösterelim.
server olarak Raspberry Pi ve Nginx kullandım.
Raspberry Pi üzerinde Minibian kurulu.
Kurulum.
1 | apt-get install nginx git-core |
1 | apt-get install fcgiwrap spawn-fcgi |
Öncelikle depo kullanıcısını sisteme ekleyelim.
1 | adduser --home /srv/depo --shell /bin/bash depo |
depo kullanıcısına geçip git proje depolarını hazırlayalım
1 2 3 4 5 6 7 8 | su - depo mkdir git cd git mkdir -p proje1.git proje2.git proje3.git for i in proje1.git proje2.git proje3.git; do cd $i; git init --bare; cd ..; done Initialized empty Git repository in /srv/depo/git/proje1.git/ Initialized empty Git repository in /srv/depo/git/proje2.git/ Initialized empty Git repository in /srv/depo/git/proje3.git/ |
Proje klasörlerimizin açıklamalarını yazalım.
1 2 3 | echo "ilk projem">proje1.git/description echo "ikinci projem" >proje2.git/description echo "üçüncü projem" >proje3.git/description |
Proje depoları artık hazır.
şimdi NginX ayarlarına geçelim.
1 2 3 | exit logout cd /etc/nginx/sites-available/ |
Default dosyasının yedeğini alalım.
1 | cp -a default default.yedek |
default yapılandırmanın içeriğini boşaltalım.
1 | :>default |
Dosyayı Düzenleyelim.
1 | nano default |
dosya içeriğine yapıştırın.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | server { listen 80 default; access_log /var/log/nginx/gitweb.access.log; error_log /var/log/nginx/gitweb.error.log info; location /index.cgi { root /usr/share/gitweb/; include fastcgi_params; gzip off; fastcgi_param SCRIPT_NAME $uri; fastcgi_param GITWEB_CONFIG /etc/gitweb.conf; fastcgi_pass unix:/var/run/fcgiwrap.socket; } location / { root /usr/share/gitweb/; index index.cgi; } } |
Kaydedip çıkın.
şimdi gitweb.conf dosyasını oluşturalım.
1 | nano /etc/gitweb.conf |
dosya içeriğine yapıştırın.
1 2 3 | #------------------ Başlama our $projectroot = "/srv/depo/git"; #------------------ Bitiş |
Kaydedip çıkın.
Servisleri yeniden başlatalım.
1 2 3 4 | service nginx restart Restarting nginx: nginx. service fcgiwrap restart [ ok ] Restarting FastCGI wrapper: fcgiwrap |
Örnek olması açısından github dan Zangetsu bloğu yansıladım.
1 2 3 4 5 6 7 8 9 10 | cd git/ $ ls proje1.git proje2.git proje3.git git clone --bare https://github.com/caglar10ur/zangetsu Cloning into bare repository 'zangetsu.git'... remote: Counting objects: 2290, done. remote: Total 2290 (delta 0), reused 0 (delta 0), pack-reused 2290 Receiving objects: 100% (2290/2290), 1.02 MiB | 369 KiB/s, done. Resolving deltas: 100% (1117/1117), done. echo "zangetsu.git yansısı" > zangetsu.git/description |
iyi eğlenceler.
https://github.com/caglar10ur/zangetsu
https://www.syslogs.org/centos-uzerinde-git-server-gitweb-kurulumu/
https://misterpinchy.wordpress.com/2012/11/01/gitweb-and-nginx/
UYARI Ticari projelerinizi public etmeyiniz, oluşacak veri kayıplarından, hatalardan vb. sorumlu değilim. tüm sorumluluk size aittir.