Gitlab+Jenkins學習之路(三)之gitlab權限管理--issue管理

  • 1.建立Group,User,Project

建立一個組,組名爲javahtml

Group path http://192.168.56.11/java
Visibility Level:    #爲權限級別,通常使用Private
Private
Internal
Public

建立一個PM的用戶做爲項目管理者並加入到java組內java

image.png

 

建立一個項目:node

建立dev1和dev2的用戶做爲開發者,並加入到項目中linux

 

  •  2.測試dev1,dev2拉取代碼庫

 

1)生成ssh-key
[root@linux-node1 ~]# ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:Hf3O9F7sS9N04cFUr3Awb/Wec28gTpHYyRZMCzLW9q0 root@linux-node1
The key's randomart image is:
+---[RSA 2048]----+
|        +..o=  .+|
|       . oo*.Oo.o|
|         .o.@.++o|
|         . o.*oo+|
|        S . o.=+=|
|           oE= =*|
|            . ooB|
|              .+o|
|               .+|
+----[SHA256]-----+
[root@linux-node1 ~]# cat .ssh/id_rsa.pub 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLDVIqTAvJtj8Uc+SvhcKOKuDtURt3YBxHo9enUkDjOWtSygLZI4hSrEsnvjHdnxeBGOgjPrxEfMMdNCno4pox7V/8bIU9LRVp2eeQFS+N+bSmbJlTKyODa0tabPwT7URYoiFI3giQamQdA0AwwPCPM/RcXwHJsw4q0O/2woCqNKq2tHaUFBqojd2KvqavzpB+4+AdKJSoabwLhE8dzfjIR/eHY31Y2C/+m9sU504v+R0GsAqr5uifi6Ct9eFvumI54BvHssIpZFZmADTT35b1aP0WSwZb2VEhXjaia8L6h/6ANn1NuHGgYZqNiYT6JILESKbrc7PyJOn9DfHKSMq9 root@linux-node1
 
(2)將公鑰(id_rsa.pub)放進dev1帳戶中
在admin帳戶下給dev1,dev2帳戶設置密碼,而後使用dev1登陸gitlab,作以下操做添加ssh-key:
測試是否能正常拉取代碼庫app1
[root@linux-node1 ~]# git clone git@192.168.56.11:java/app1.git
Cloning into 'app1'...
The authenticity of host '192.168.56.11 (192.168.56.11)' can't be established.
ECDSA key fingerprint is SHA256:p2lhKmsPQ6K+dWHHvbJg0GV+Ni9VM7vlViKrYsZLP1s.
ECDSA key fingerprint is MD5:22:14:1c:37:de:47:1c:4a:2f:88:b1:dc:e2:d0:02:17.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.56.11' (ECDSA) to the list of known hosts.
warning: You appear to have cloned an empty repository.
Checking connectivity... done.
[root@linux-node1 ~]# ll
total 6804
-rw-------.  1 root root     948 Dec  3 01:21 anaconda-ks.cfg
drwxr-xr-x   3 root root      17 Dec 20 15:00 app1
drwxr-xr-x  22 root root   24576 Dec  8 22:16 git-2.7.4
drwxr-xr-x   3 root root      65 Dec  9 01:23 test
-rw-r--r--   1 root root 6918037 Dec  8 22:09 v2.7.4.zip
[root@linux-node1 ~]# cd app1
[root@linux-node1 app1]# ll
total 4
-rw-r--r-- 1 root root 19 Dec 20 15:05 readme

到此,Linux環境下完成了gitlab的受權管理代碼庫。git

 

下面以PM用戶進行建立開發計劃app

開發一個官網V1.0版本,包含首頁和新聞dom

 (1)建立里程碑(Milestonessh

(2)依次把任務首頁,新聞添加到里程碑,並進行任務分配給開發者ide

(3)使用dev1用戶登陸查看,會有任務提示,如圖:gitlab

(4)dev1開發者收到任務,進行開發

[root@linux-node1 app1]# git checkout -b shouye    #建立首頁分支
Switched to a new branch 'shouye'
[root@linux-node1 app1]# git status
On branch shouye
nothing to commit, working directory clean
[root@linux-node1 app1]# echo "<h1> welcome to www.123.com" > index.html    #進行開發
[root@linux-node1 app1]# ll
total 8
-rw-r--r-- 1 root root 28 Dec 20 15:50 index.html
-rw-r--r-- 1 root root 19 Dec 20 15:05 readme
[root@linux-node1 app1]# git add .
[root@linux-node1 app1]# git commit -m "shouye"    #開發完成,提交本地倉庫
[shouye babdcb5] shouye
 1 file changed, 1 insertion(+)
 create mode 100644 index.html
[root@linux-node1 app1]# git push origin shouye    #提交到遠程庫
Counting objects: 3, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 292 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: 
remote: To create a merge request for shouye, visit:
remote:   http://192.168.56.11/java/app1/merge_requests/new?merge_request%5Bsource_branch%5D=shouye
remote: 
To git@192.168.56.11:java/app1.git
 * [new branch]      shouye -> shouye
  
 能夠看到有剛纔建立的分支,點擊"merge request"合併分支請求,以後PM用戶登陸處理合並請求。此時,一個功能的開發流程就完成。

總結:

  1. PM在gitlab建立任務,分配給開發人員

  2. 開發人員領取任務後,在本地使用git clone拉取代碼庫

  3. 開發人員建立開發分支(git checkout -b dev),並進行開發

  4. 開發人員完成以後,提交到本地倉庫(git commit )

  5. 開發人員在gitlab界面上申請分支合併請求(Merge request)

  6. PM在gitlab上查看提交和代碼修改狀況,確認無誤後,確認將開發人員的分支合併到主分支(master)

  7. 開發人員在gitlab上Mark done確認開發完成,並關閉issue。這一步在提×××並請求時能夠經過描述中填寫"close #1"等字樣,能夠直接關閉issue。

相關文章
相關標籤/搜索