gitlabȨÏÞÅÌÎʵÄÈýÖÖÒªÁì
ÔÚʹÓÃgitlab¾ÙÐа汾ÖÎÀíºÍ´úÂëÐ×÷µÄÀú³ÌÖУ¬È¨ÏÞÖÎÀíÊǺÜÊÇÖ÷ÒªµÄ¡£²î±ðµÄÓû§»òÓû§×éÐèÒª²î±ðµÄȨÏÞ£¬ÒÔÈ·±£´úÂëµÄÇå¾²ÐԺͺϹæÐÔ¡£ÔÚgitlabÖУ¬¿ÉÒÔͨ¹ý¶àÖÖ·½·¨À´ÅÌÎÊȨÏÞ£¬±¾ÎĽ«¼òÆÓÏÈÈÝÆäÖм¸ÖÖ·½·¨¡£
ͨ¹ýWeb½çÃæÅÌÎÊȨÏÞ
GitLabµÄWeb½çÃæÌṩÁ˱ã½ÝµÄȨÏÞÅÌÎÊ·½·¨¡£Ö»ÐèÒªµÇ¼GitLabºó½øÈëÏîÄ¿Ò³Ã棬µã»÷Ò³ÃæÓÒÉϽǵĔSettings”°´Å¥£¬ÔÚµ¯³öµÄÏÂÀ²Ëµ¥ÖÐÑ¡Ôñ”Members”Ñ¡Ïî¼´¿ÉÉó²éÄ¿½ñÏîÄ¿µÄ³ÉÔ±ÁÐ±í¼°ÆäȨÏÞÉèÖá£
ÔÚ³ÉÔ±ÁбíÖУ¬¿ÉÒÔ¿´µ½Ã¿Î»³ÉÔ±µÄ½ÇÉ«¡¢×îºóÒ»´ÎÔ˶¯Ê±¼äµÈÐÅÏ¢¡£µã»÷ÏìÓ¦³ÉÔ±Ãû×ÖÅԱߵĔEdit”°´Å¥£¬¿ÉÒÔÉó²é¸Ã³ÉÔ±ÔÚÄ¿½ñÏîÄ¿ÖеÄȨÏÞÉèÖ㬰üÀ¨»á¼û¼¶±ð¡¢È¨ÏÞ¹æÄ£µÈ¡£
ͨ¹ýÏÂÁîÐÐÅÌÎÊȨÏÞ
³ýÁËWeb½çÃ棬»¹¿ÉÒÔͨ¹ýÏÂÁîÐй¤¾ßÅÌÎÊGitLabȨÏÞ¡£Ê×ÏÈÐèҪװÖÃGitLabÏÂÁîÐй¤¾ß£¬È»ºóͨ¹ýÏÂÁî”gitlab-ctl”½øÈëGitLabЧÀÍÆ÷¿ØÖÆ̨¡£
ÔÚ¿ØÖÆ̨ÖУ¬¿ÉÒÔʹÓÔgitlab-rails”ÏÂÁîÅÌÎÊÏîÄ¿³ÉÔ±ºÍȨÏÞ¡£ÀýÈ磬ÅÌÎÊij¸öÏîÄ¿ÏÂËùÓгÉÔ±µÄȨÏÞÐÅÏ¢£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
gitlab-rails runner "Project.find_by_path(\"<project_path>\").members.each { |m| puts \"#{m.user.username}: #{m.access_level}\" }"</project_path>
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬” “ΪÏîÄ¿µÄ·¾¶¡£
ͨ¹ýAPIÅÌÎÊȨÏÞ
ÁíÍ⣬GitLabÒ²ÌṩÁËAPI½Ó¿Ú£¬¿ÉÒÔͨ¹ýAPIÅÌÎÊȨÏÞÐÅÏ¢¡£ÐèÒªÏÈ»ñÈ¡GitLab API»á¼ûtoken£¬È»ºó¿ÉÒÔʹÓÃÒÔÏÂAPIÀ´ÅÌÎÊÏîÄ¿³ÉÔ±ºÍȨÏÞ£º
GET /projects/:id/members
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬”:id”ΪÏîÄ¿µÄID¡£Í¨¹ý¸ÃAPI¿ÉÒÔ»ñÈ¡ÏîÄ¿³ÉÔ±µÄÁÐ±í¼°ÆäȨÏÞÐÅÏ¢¡£
×ܽ᣺
ÒÔÉÏÏÈÈÝÁËGitLabÖм¸ÖÖ³£¼ûµÄÅÌÎÊȨÏ޵ķ½·¨£¬´ÓWeb½çÃæµ½ÏÂÁîÐÐÔÙµ½API¡£Ñ¡Ôñ²î±ðµÄ·½·¨£¬¿ÉÒÔƾ֤ÏÖÕæÏàÐοìËÙÅÌÎÊGitLabȨÏÞÐÅÏ¢£¬±ãÓÚ¾ÙÐÐȨÏÞÖÎÀíºÍ´úÂëÐ×÷¡£
ÒÔÉϾÍÊÇgitlabȨÏÞÅÌÎʵÄÈýÖÖÒªÁìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡