自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

DevOps-版本控制系統(tǒng)-GitLab部署

開源
本篇給大家介紹DevOps-版本控制系統(tǒng)-GitLab部署,希望對(duì)你有所幫助。

 使用RPM包部署

這里使用的系統(tǒng)是CentOS8, 清華源:mirrors.tuna.tsinghua.edu.cn/gitlab-ce/

  1. ## 下載軟件包 
  2. wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/gitlab-ce-13.7.0-ce.0.el8.x86_64.rpm 
  3.  
  4. ## 安裝 
  5. rpm -ivh gitlab-ce-13.7.0-ce.0.el8.x86_64.rpm 
  6.  
  7. ## 日志輸出 
  8. warning: gitlab-ce-13.7.0-ce.0.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID f27eab47: NOKEY 
  9. Verifying...                          ################################# [100%] 
  10. Preparing...                          ################################# [100%] 
  11. Updating / installing... 
  12.    1:gitlab-ce-13.7.0-ce.0.el8        ################################# [100%] 
  13. It looks like GitLab has not been configured yet; skipping the upgrade script. 
  14.  
  15.        *.                  *. 
  16.       ***                 *** 
  17.      *****               ***** 
  18.     .******             ******* 
  19.     ********            ******** 
  20.    ,,,,,,,,,***********,,,,,,,,, 
  21.   ,,,,,,,,,,,*********,,,,,,,,,,, 
  22.   .,,,,,,,,,,,*******,,,,,,,,,,,, 
  23.       ,,,,,,,,,*****,,,,,,,,,. 
  24.          ,,,,,,,****,,,,,, 
  25.             .,,,***,,,, 
  26.                 ,*,. 
  27.  
  28.  
  29.  
  30.      _______ __  __          __ 
  31.     / ____(_) /_/ /   ____ _/ /_ 
  32.    / / __/ / __/ /   / __ `/ __ \ 
  33.   / /_/ / / /_/ /___/ /_/ / /_/ / 
  34.   \____/_/\__/_____/\__,_/_.___/ 
  35.  
  36.  
  37. Thank you for installing GitLab! 
  38. GitLab was unable to detect a valid hostname for your instance. 
  39. Please configure a URL for your GitLab instance by setting `external_url` 
  40. configuration in /etc/gitlab/gitlab.rb file. 
  41. Then, you can start your GitLab instance by running the following command: 
  42.   sudo gitlab-ctl reconfigure 
  43.  
  44. For a comprehensive list of configuration options please see the Omnibus GitLab readme 
  45. https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md 
  46.  
  47. Help us improve the installation experience, let us know how we did with a 1 minute survey: 
  48. https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=13-7 

配置

安裝完成后可以發(fā)現(xiàn)以下信息,需要修改gitlab.rb配置文件。

  • GitLab was unable to detect a valid hostname for your instance. Please configure a URL for your GitLab instance by setting external_urlconfiguration in /etc/gitlab/gitlab.rb file. Then, you can start your GitLab instance by running the following command: sudo gitlab-ctl reconfigure

編輯 /etc/gitlab/gitlab.rb 可以看到默認(rèn)的域名配置。如果是學(xué)習(xí)使用則可以繼續(xù)使用該域名,不用再做其他配置。

  1. 32 external_url 'http://gitlab.example.com' 

如果是需要修改該域名,則需要這樣做:

  1. ## 修改gitlab.rb 
  2. external_url 'http://gitlab.devops.com' 
  3. ## 重新配置 
  4. gitlab-ctl reconfigure 

服務(wù)運(yùn)行控制

  1. ## 啟動(dòng)服務(wù) 
  2. gitlab-ctl start 
  3. ## 重啟服務(wù) 
  4. gitlab-ctl restart  
  5. ## 查看狀態(tài) 
  6. gitlab-ctl status  
  7. ## 停止 
  8. gitlab-ctl stop 

訪問測(cè)試

由于使用的是gitlab.devops.com 這個(gè)域名,需要在dns或者本地hosts中添加該解析記錄。

  1. vi /etc/hosts 
  2. 192.168.1.200 gitlab.devops.com 

瀏覽器訪問http://gitlab.devops.com/, 設(shè)置用戶密碼。默認(rèn)用戶root。這里設(shè)置的密碼是devops1234。


能夠正常進(jìn)入首頁即可,安裝完成。


擴(kuò)展:使用外部PG數(shù)據(jù)庫

使用docker快速啟動(dòng)PG

  • You are using PostgreSQL 9.6.16, but PostgreSQL >= 11 is required for this version of GitLab.
  1. mkdir /root/gitlab/pgdata 
  2.  
  3. docker run --name dockerPG11 \ 
  4. -e POSTGRES_PASSWORD=postgres \ 
  5. -v /root/gitlab/pgdata:/var/lib/postgresql/data \ 
  6. -p 54322:5432 \ 
  7. -d postgres:11.5 
  8.  
  9. ## 創(chuàng)建數(shù)據(jù)庫 
  10. psql -U postgres -h localhost -p 54322 
  11. psql (11.5 (Debian 11.5-3.pgdg90+1)) 
  12. Type "help" for help. 
  13. postgres=# create role gitlab login encrypted password 'gitlab'
  14. CREATE ROLE 
  15. postgres=# create database gitlabhq_production owner=gitlab ENCODING = 'UTF8'
  16. CREATE DATABASE 
  17. postgres=# \c gitlabhq_production 
  18. You are now connected to database "gitlabhq_production" as user "postgres"
  19. gitlabhq_production=# CREATE EXTENSION IF NOT EXISTS btree_gist; 
  20. CREATE EXTENSION 
  21. gitlabhq_production=# CREATE EXTENSION IF NOT EXISTS pg_trgm; 
  22. CREATE EXTENSION 
  23. postgres=# \q 

使用postgres用戶創(chuàng)建 EXTENSION, btree_gist, pg_trgm。否則會(huì)遇到如下錯(cuò)誤:

  • STDOUT: psql:/opt/gitlab/embedded/service/gitlab-rails/db/structure.sql:9: ERROR: permission denied to create extension "btree_gist" HINT: Must be superuser to create this extension.

修改gitlab.rb配置文件

編輯/etc/gitlab/gitlab.rb

  1. 654 gitlab_rails['db_adapter'] = "postgresql" 
  2. 655 gitlab_rails['db_encoding'] = "utf8" 
  3. 656 # gitlab_rails['db_collation'] = nil 
  4. 657 gitlab_rails['db_database'] = "gitlabhq_production" 
  5. 658 gitlab_rails['db_username'] = "gitlab" 
  6. 659 gitlab_rails['db_password'] = "gitlab" 
  7. 660 gitlab_rails['db_host'] = "192.168.1.200" 
  8. 661 gitlab_rails['db_port'] = 54322 
  9. 1025 postgresql['enable'] = false 
  10.  
  11. ## 配置更新 
  12. gitlab-ctl reconfigure 

驗(yàn)證配置生效

  1. cat /opt/gitlab/embedded/service/gitlab-rails/config/database.yml 
  2.  
  3. # This file is managed by gitlab-ctl. Manual changes will be 
  4. # erased! To change the contents below, edit /etc/gitlab/gitlab.rb 
  5. and run `sudo gitlab-ctl reconfigure`. 
  6.  
  7. production: 
  8.   adapter: postgresql 
  9.   encoding: utf8 
  10.   collation: 
  11.   database: gitlabhq_production 
  12.   username: "gitlab" 
  13.   password"gitlab" 
  14.   host: "192.168.1.200" 
  15.   port: 54322 

 

責(zé)任編輯:姜華 來源: DevOps云學(xué)堂
相關(guān)推薦

2009-03-23 09:53:47

LinuxGNOMEGit版本

2021-02-03 07:16:49

DevOps開發(fā)工具

2009-04-01 17:58:28

MercurialPython版本控制

2011-04-08 18:00:19

GitSubversion版本控制系統(tǒng)

2011-01-26 09:09:06

版本控制系統(tǒng)GitLinux

2022-09-14 09:18:52

SubversionLinux系統(tǒng)

2022-03-17 00:07:00

工業(yè)控制系統(tǒng)

2022-09-13 09:00:19

SubversionLinux

2020-09-27 09:50:35

自動(dòng)化

2021-12-08 14:06:19

Python語音識(shí)別開發(fā)

2014-06-23 10:22:18

2017-09-01 06:45:37

2020-06-15 10:53:16

工控安全工業(yè)控制網(wǎng)絡(luò)安全

2023-05-24 14:58:23

2023-10-16 12:42:00

物聯(lián)網(wǎng)IOT

2010-09-14 14:22:22

2023-10-24 20:41:28

物聯(lián)網(wǎng)控制系統(tǒng)

2010-06-04 09:33:34

電子訪問控制生物識(shí)別身份驗(yàn)證

2023-07-31 10:15:14

物聯(lián)網(wǎng)智能家居

2013-10-30 09:54:32

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)