ÔõÑùÔÚLinuxϵͳÉϴGitLab
gitlabÊÇÒ»¸ö»ùÓÚgit°æ±¾¿ØÖÆϵͳµÄwebÓ¦ÓóÌÐò£¬Ö¼ÔÚÖÎÀí´úÂë¿â¡¢´úÂëÉóºË¡¢Ðû²¼ÓëÐ×÷µÈ£¬ÊÇÒ»¸öºÜÊÇÊʺÏÍŶÓÐ×÷µÄ¿ªÔ´ÏîÄ¿ÖÎÀíƽ̨¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚlinuxϵͳÉϴgitlab£¬ÒÔ¼°ÔõÑù¾ÙÐÐÖÐÎÄ»¯£¬²¢Ê¹ÓÃÓʼþ֪ͨµÄ¹¦Ð§¡£
ÇéÐÎ×¼±¸
1.²Ù×÷ϵͳ£ºCentOS 7»òÕßUbuntu 16.04
2.Êý¾Ý¿â£ºPostgreSQL»òMySQL
3.ÓʼþЧÀÍ£º¿ÉÒÔʹÓÃPostfix»òÕßEximµÈÓʼþЧÀÍ
4.ÓòÃû£º½¨ÒéʹÓöþ¼¶ÓòÃû£¬ÀýÈçgitlab.example.com
×°ÖÃGitLab
1.×°ÖÃÐëÒªµÄÈí¼þ°ü
ʹÓÃÒÔÏÂÏÂÁîÀ´×°ÖÃÐëÒªµÄÈí¼þ°ü£º
sudo yum install curl policycoreutils openssh-server openssh-clients postfix
µÇ¼ºó¸´ÖÆ
2.Ìí¼ÓGitLabµÄGPG Key
ʹÓÃÒÔÏÂÏÂÁ½«GitLabµÄGPG KeyÌí¼Óµ½ÏµÍ³ÖУº
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add -
µÇ¼ºó¸´ÖÆ
3.Ìí¼ÓGitLabÔ´
ʹÓÃÒÔÏÂÏÂÁîÀ´Ìí¼ÓGitLabÔ´£º
sudo curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
µÇ¼ºó¸´ÖÆ
4.×°ÖÃGitLab
ʹÓÃÒÔÏÂÏÂÁîÀ´×°ÖÃGitLab£º
sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce
µÇ¼ºó¸´ÖÆ
×¢ÖØ£ºÆäÖеÄEXTERNAL_URLÐèÒªÐÞ¸ÄΪÄãµÄ¶þ¼¶ÓòÃû¡£
5.Æô¶¯GitLabЧÀÍ
×°ÖÃÍê³Éºó£¬Ê¹ÓÃÒÔÏÂÏÂÁîÀ´Æô¶¯GitLabЧÀÍ£º
sudo gitlab-ctl reconfigure
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÖÐÎÄ»¯GitLab
ÔÚ×°ÖÃÍê³ÉGitLabºó£¬Ä¬ÈϵÄÓïÑÔÊÇÓ¢ÎÄ£¬ÎªÁ˸üºÃµØ˳ӦÖÐÎĵÄʹÓã¬ÎÒÃÇÐèÒª½«GitLab¾ÙÐÐÖÐÎÄ»¯¡£
1.ÐÞ¸ÄÉèÖÃÎļþ
ÔÚGitLabµÄÉèÖÃÎļþÖÐÌí¼ÓÒÔÏÂÉèÖãº
sudo vim /etc/gitlab/gitlab.rb
µÇ¼ºó¸´ÖÆ
ÔÚÎļþµÄĩβÌí¼ÓÒÔÏ´úÂ룺
## Chinese Language gitlab_rails['translations'] = { 'zh-CN' => 'Simplified Chinese' } gitlab_rails['gitlab_default_theme'] = 2 gitlab_workhorse['auth_backend'] = "http://127.0.0.1:8080"
µÇ¼ºó¸´ÖÆ
2.ÉúЧÉèÖÃÎļþ
ÔÚÌí¼ÓÍêÉèÖúó£¬Ê¹ÓÃÒÔÏÂÏÂÁîÈÃÉèÖÃÎļþÉúЧ£º
sudo gitlab-ctl reconfigure
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
3.ÖØÆôЧÀÍ
ʹÓÃÒÔÏÂÏÂÁЧÀÍÖØÆô£º
sudo gitlab-ctl restart
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
Óʼþ֪ͨÉèÖÃ
GitLabÖ§³ÖÓʼþ֪ͨ¹¦Ð§£¬Í¨¹ýÉèÖÃÓʼþЧÀÍ¿ÉÒÔʵÏÖGitLabµÄÓʼþ֪ͨ¹¦Ð§¡£
1.×°ÖÃÓʼþЧÀÍ
ʹÓÃÒÔÏÂÏÂÁîÀ´×°ÖÃPostfixÓʼþЧÀÍ£º
sudo yum install postfix
µÇ¼ºó¸´ÖÆ
2.ÉèÖÃÓʼþЧÀÍ
ÔÚ×°ÖÃÍêÓʼþЧÀͺó£¬Ê¹ÓÃÒÔÏÂÏÂÁî¾ÙÐÐÉèÖãº
sudo vim /etc/postfix/main.cf
µÇ¼ºó¸´ÖÆ
ÔÚÉèÖÃÎļþÖÐÌí¼ÓÒÔÏÂÉèÖãº
relayhost = [smtp.example.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt smtp_use_tls = yes
µÇ¼ºó¸´ÖÆ
ÆäÖÐrelayhostÐèҪƾ֤ÏÖÕæÏàÐÎÌîд¡£
3.Ìí¼ÓÈÏÖ¤ÐÅÏ¢
ÔÚ/etc/postfix/sasl_passwdÎļþÖÐÌí¼ÓÈÏÖ¤ÐÅÏ¢£º
[smtp.example.com]:587 your_username:your_password
µÇ¼ºó¸´ÖÆ
ÆäÖÐ[smtp.example.com]:587ÐèҪƾ֤ÏÖÕæÏàÐÎÌîд¡£
4.ÖØÔØÉèÖÃ
ʹÓÃÒÔÏÂÏÂÁîÀ´ÖØÔØÉèÖãº
sudo postmap /etc/postfix/sasl_passwd sudo systemctl reload postfix
µÇ¼ºó¸´ÖÆ
5.ÐÞ¸ÄGitLabÉèÖÃ
ÔÚGitLabµÄÉèÖÃÎļþÖÐÌí¼ÓÒÔÏÂÉèÖãº
gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.example.com" gitlab_rails['smtp_port'] = 587 gitlab_rails['smtp_user_name'] = "your_username" gitlab_rails['smtp_password'] = "your_password" gitlab_rails['smtp_domain'] = "example.com" gitlab_rails['smtp_authentication'] = :login gitlab_rails['smtp_enable_starttls_auto'] = true
µÇ¼ºó¸´ÖÆ
ÆäÖÐsmtp_address¡¢smtp_user_name¡¢smtp_password¡¢smtp_domainÐèҪƾ֤ÏÖÕæÏàÐÎÌîд¡£
6.ÖØÆôGitLabЧÀÍ
ʹÓÃÒÔÏÂÏÂÁîÀ´ÖØÆôGitLabЧÀÍ£º
sudo gitlab-ctl restart
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÖÁ´Ë£¬GitLabµÄÓʼþ֪ͨ¹¦Ð§ÉèÖÃÍê³É¡£
×ܽá
±¾ÎÄÏÈÈÝÁËÔõÑùÔÚLinuxϵͳÉϴGitLab£¬²¢¶ÔÆä¾ÙÐÐÖÐÎÄ»¯ºÍÓʼþ֪ͨ¹¦Ð§µÄÉèÖá£ÓÉÓÚGitLabÌṩÁ˸»ºñµÄ¹¦Ð§ºÍÀ©Õ¹£¬Ê¹µÃÆä³ÉΪºÜÊÇÊʺÏÍŶÓÐ×÷µÄ¿ªÔ´ÏîÄ¿ÖÎÀíƽ̨¡£Ï£Íû±¾ÎÄÄܶԸ÷ÈËÓÐËù×ÊÖú¡£
ÒÔÉϾÍÊÇÔõÑùÔÚLinuxϵͳÉϴGitLabµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡