尊龙凯时人生就是博

ÔõÑùÔÚ NUC Éϴ×Ô¼ºµÄ Gitlab ЧÀÍÆ÷

ÔÚÈí¼þ¿ª·¢ÁìÓòÖУ¬°æ±¾¿ØÖÆÊǺÜÊÇÖ÷ÒªµÄ¹¤¾ß¡£Ëü¿ÉÒÔ×ÊÖúÍŶÓÔÚÂþÑÜÔÚ²î±ðµØÓßλÖõĿª·¢ÕßÖ®¼äЭ×÷£¬ÔÚ²î±ðµÄ°æ±¾¡¢·ÖÖ§ÉÏ¿ª·¢¡¢µ÷ÊԺͲâÊÔ´úÂë¡£gitÊÇ×îÊ¢ÐеĿªÔ´°æ±¾¿ØÖƹ¤¾ßÖ®Ò»¡£¶øÔÚСÎÒ˽ÈË¿ª·¢Õß»òÕßСÐÍÍŶÓÖУ¬Ãâ·ÑµÄ gitlab ¿ÉÒÔ×ÊÖúËûÃÇʵÏÖ×Ô¼ºµÄ°æ±¾¿ØÖÆϵͳ¡£¶ø±¾ÎĽ«ÏÈÈÝÔõÑùÔÚ nuc Éϴ×Ô¼ºµÄ gitlab ЧÀÍÆ÷¡£

NUC ¼ò½é

Intel NUC£¨£Îext Unit of Computing£©ÊÇÒ»ÖÖÃÔÄãµçÄÔ£¬ËüµÄÌå»ýºÜÊÇС£¬¿ÉÊÇÉèÖúÜÊÇÇ¿Ê¢¡£NUC µÄ¸ßÐÔÄÜ´¦ÀíÆ÷¡¢ÄÚ´æ¡¢Ó²Å̺ÍÍøÂç½Ó¿ÚÊÇÕâЩװ±¸µÄÖ÷ÒªÌØÕ÷¡£

´î½¨ÇéÐÎ

ÔÚ×îÏȴÎÒÃÇµÄ Gitlab ЧÀÍÆ÷֮ǰ£¬ÎÒÃÇÐèҪ׼±¸Ò»¸ö NUC ÔËÐÐÇéÐΡ£ÎÒÃÇÒªÇóÕâ¸öÇéÐξßÓÐÒÔÏÂÌص㣺

²Ù×÷ϵͳ£ºUbuntu 18.04.5 LTS

Äڴ棺ÖÁÉÙ 4GB

Ó²ÅÌ£ºÖÁÉÙ 60GB

ÍøÂ磺ÓÐÒ»¸ö¹«ÍøIPµØµã£¬²¢ÄÜ»á¼û22ºÍ80¶Ë¿Ú

ÉèÖð취

µÚÒ»²½£º¸üÐÂÈí¼þ°ü

ÔÚÎÒÃÇ×îÏÈ×°Öà Gitlab ֮ǰ£¬ÎÒÃÇÐèÒª¸üÐÂÈí¼þ°ü£º

sudo apt update
sudo apt upgrade

µÇ¼ºó¸´ÖÆ

µÚ¶þ²½£º×°Öñر¸Èí¼þ

ÔÚ×°Öà Gitlab Ç°ÎÒÃÇÐèҪװÖà Git¡¢PostgreSQL ºÍ Nginx£º

sudo apt install -y curl openssh-server ca-certificates
sudo apt install -y postfix
sudo apt install -y git-core
sudo apt install -y postgresql postgresql-contrib
sudo apt install -y nginx

µÇ¼ºó¸´ÖÆ

×°ÖÃÁËÕâЩÈí¼þ°üÖ®ºó£¬ÎÒÃÇÐèÒªÉèÖà PostgreSQL Êý¾Ý¿âºÍ Nginx ЧÀÍÆ÷¡£

µÚÈý²½£ºÉèÖà PostgreSQL Êý¾Ý¿â

ÔÚ Gitlab ÖУ¬ÎÒÃÇʹÓà PostgreSQL ×÷ΪÊý¾Ý¿âÒýÇæ¡£ÎÒÃÇÐèÒª½¨ÉèÒ»¸öÔËÐÐ Gitlab µÄÓû§£¬ÒÔ¼°Ò»¸öÃûΪgitlabhq_productionµÄÊý¾Ý¿â¡£

sudo su - postgres
createuser --interactive
createdb gitlabhq_production

µÇ¼ºó¸´ÖÆ

½¨ÉèÊý¾Ý¿âºó£¬ÎÒÃÇÐèÒª½«ÆäÉèÖõ½ Gitlab¡£ÎÒÃÇ·­¿ª²¢±à¼­ÉèÖÃÎļþ/etc/gitlab/gitlab.rb¡£ÔÚÆäÖÐÕÒµ½ÏÂÃæµÄÓï¾ä£¬×÷·Ï×¢ÊÍ£¬²¢ÐÞ¸ÄΪÒÔÏÂÄÚÈÝ£º

## GitLab Postgres connection settings
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'unicode'
gitlab_rails['db_host'] = '127.0.0.1'
gitlab_rails['db_port'] = '5432'
gitlab_rails['db_username'] = 'git'
gitlab_rails['db_password'] = 'password'
gitlab_rails['db_database'] = 'gitlabhq_production'

µÇ¼ºó¸´ÖÆ

µÚËIJ½£º×°Öà Gitlab

ÎÒÃÇ¿ÉÒÔ´Ó Gitlab ¹Ù·½ÍøÕ¾ÖÐÏÂÔØ Gitlab ÉçÇø°æ£º

curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce

µÇ¼ºó¸´ÖÆ

ÆÚ´ý×°ÖÃÍê±Ïºó£¬ÔËÐÐÒÔÏÂÏÂÁîÆô¶¯ Gitlab ЧÀÍÆ÷£º

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

µÇ¼ºó¸´ÖÆ

µÚÎå²½£ºÉèÖà Nginx

Gitlab ʹÓà Nginx ×÷Ϊ Web ЧÀÍÆ÷¡£ÕâÀïÎÒÃÇÐèÒªÐÞ¸Ä Nginx µÄÉèÖÃÎļþ/etc/nginx/sites-available/gitlab£º

sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/gitlab
sudo nano /etc/nginx/sites-available/gitlab

## Ð޸ĠGitlab ÉèÖÃÎļþÖеÄÄÚÈÝÈçÏ ##
upstream gitlab-workhorse {
  server unix:/var/opt/gitlab/gitlab-workhorse/socket fail_timeout=0;
}

server {
    listen 80;
    server_name yourdomain.com;
    server_tokens off;

    client_max_body_size 250m;

    location / {
        proxy_pass http://gitlab-workhorse;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_read_timeout 300;
    }

    error_page 404 /404.html;
        location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
    }
}

µÇ¼ºó¸´ÖÆ

µ±ÐÞ¸ÄÍê³Éºó£¬ÔËÐÐÒÔÏÂÏÂÁ»îÉèÖÃÎļþ£º

sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

µÇ¼ºó¸´ÖÆ

×îºó£¬ÎÒÃÇ·­¿ªä¯ÀÀÆ÷£¬»á¼û Gitlab ÔÚ NUC ÉÏÔËÐÐµÄ URL£ºhttp://yourdomain.com¡£

½áÂÛ

ÔÚ±¾ÎÄÖУ¬ÎÒÃÇѧϰÁËÔõÑùÔÚ NUC Éϴ×Ô¼ºµÄ Gitlab ЧÀÍÆ÷¡£ÎÒÃÇÊ×ÏÈ×¼±¸ÁËÒ»¸öÔËÐÐ Ubuntu 18.04.5 LTS µÄ NUC ÇéÐΣ¬È»ºó×°ÖÃÁËÐëÒªµÄÈí¼þ°ü£¬ÉèÖÃÁË PostgreSQL Êý¾Ý¿âºÍ Nginx ЧÀÍÆ÷£¬×°ÖÃÁË Gitlab ÉçÇø°æ£¬²¢½«ÆäÉèÖÃΪÔÚ NUC ÉÏÔËÐС£ÏÖÔÚ£¬ÎÒÃÇ¿ÉÒÔÈÃÎÒÃǵÄÍŶÓÔÚ×Ô¼ºµÄЧÀÍÆ÷ÉϹ²Ïí´úÂëÁË¡£

ÒÔÉϾÍÊÇÔõÑùÔÚ NUC Éϴ×Ô¼ºµÄ Gitlab ЧÀÍÆ÷µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是博ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是博ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ