LINUX——gitlab版本控制,關於項目組管理,項目用戶及權限管理的使用
阿新 • • 發佈:2018-09-04
entos 開發 chan 網頁 1.2 保存 ise roo 能力 gitlab一般用於:
1.開發工程中各種文件變更的管理
最主要的功能是追蹤文件的變更,將信息記錄下來。每一次文件的改變,版本號都會增加
1.開發工程中各種文件變更的管理
最主要的功能是追蹤文件的變更,將信息記錄下來。每一次文件的改變,版本號都會增加
2.並行開發
軟件開發時往往是多人協同,而版本控制可以解決版本同步以及不同開發者的通信問題
3.版本回退,類似於虛擬機的快照
每項開發任務中,都需要首先設定開發基線的版本,然後開發出所需的目標版本,當需求發生便變更時,通過對變更的評估,及確定變更的影響範圍,對被影響的配置項的版本進行修改
在開發需求變更被取消時,需由能力將版本回推至開發基線版本,
例:在季度升級包拆包和重新組包時,是將比分配置的版本退回開發基線,在將對應不同需求的不同分支重新組和歸並,形成新的升級包版本
//關防火墻
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# sed -ri ‘s/(SELINUX=).*/\1disabled/g‘ /etc/selinux/config
[root@localhost ~]# setenforce 0
//配置安裝163的源
[root@localhost ~]# cd /etc/yum.repos.d/ //創建備份目錄 [root@localhost yum.repos.d]# mkdir /etc/repo-bf //將原yum倉庫的文件備份到repo-bf [root@localhost yum.repos.d]# mv * /etc/repo-bf //下載163的源到yum倉庫 [root@localhost yum.repos.d]# curl -o 163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo //將改為版本的7 [root@localhost yum.repos.d]# sed -i ‘s/\$releasever/7/g‘ /etc/yum.repos.d/163.repo [root@localhost yum.repos.d]# sed -i ‘s/enabled=0/enabled=1/g‘ /etc/yum.repos.d/163.repo //自動配置yum的軟件倉庫,也可以自己配置 [root@localhost yum.repos.d]# yum -y install epel-release [root@localhost yum.repos.d]# yum clean all //安裝編譯環境 [root@localhost yum.repos.d]# yum -y install gcc gcc-c++ [root@localhost yum.repos.d]# yum -y install wget
//安裝git
[root@localhost yum.repos.d]# yum -y install epel-release git
//安裝依賴包
[root@localhost yum.repos.d]# yum -y install curl openssh-server openssh-clients postfix cronie policycoreutils-python
//啟動postfix服務並設置開機自啟動,這是個郵件服務器
[root@localhost yum.repos.d]# systemctl restart postfix [root@localhost yum.repos.d]# systemctl enable postfix
//下載gitlab的rpm包
[root@localhost yum.repos.d]# cd /usr/src/
[root@localhost src]# ls
debug kernels
[root@localhost src]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm
//安裝gitlab
[root@localhost src]# rpm -ivh gitlab-ce-11.2.1-ce.0.el7.x86_64.rpm
//修改配置文件
[root@localhost src]# vim /etc/gitlab/gitlab.rb
external_url ‘http://192.168.56.11‘ 將此處設置為gitlab的服務器地址或ip地址
//重新加載配置文件並重啟
[root@localhost src]# gitlab-ctl reconfigure
[root@localhost src]# gitlab-ctl restart
//查看當前的gitlab版本
[root@localhost src]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 11.2.1
//設置管理員密碼
[root@localhost src]# gitlab-rails console production //也可用於重置密碼
irb(main):001:0> user = User.where(id: 1).first //id為1是超級管理員
=> #<User id:1 @root>
irb(main):002:0> user.password = ‘guohui123!‘ //設置密碼
=> "guohui123!"
irb(main):003:0> user.save! //保存修改
Enqueued ActionMailer::DeliveryJob (Job ID: 983489f7-a46e-44ff-90b4-cfc966a819fd) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", gid://gitlab/User/1
=> true /無問題則返回true
irb(main):004:0> exit //退出
192.168.56.11
此處設置並輸入新密碼,
(網頁這裏可以用谷歌翻譯)
進入管理區設置,選擇項目(projects)
gitlab常用管理操作
項目管理,創建新項目
創建組,組路徑
//創建後可在項目路徑選擇項目的組
創建成員組,針對項目創建一個成員組
用戶管理,添加gitlab用戶,刪除gitlab用戶
添加用戶記得設置密碼
為項目添加用戶以及用戶的身份
普通用戶登陸,身份為開發者
做運維知道這些就差不多可以了,其他的交給開發去做就好~
LINUX——gitlab版本控制,關於項目組管理,項目用戶及權限管理的使用