区分Gitlab公开项目和私有项目

This commit is contained in:
huang 2015-11-11 15:33:43 +08:00
parent 7318b172ee
commit 16c31e254e
1 changed files with 7 additions and 2 deletions

View File

@ -10,6 +10,9 @@ module Trustie
DEVELOPER = 30
MASTER = 40
OWNER = 50
# 项目公开和私有
PUBLIC = 20
PRIVATE = 0
end
class Sync
@ -45,7 +48,8 @@ module Trustie
issues_enabled: false,
snippets_enabled: false,
public: false,
user_id: gid
user_id: gid,
visibility_level: project.is_public? ? UserLevel::PUBLIC : UserLevel::PRIVATE
)
project.gpid = gproject.id
project.save!
@ -84,7 +88,8 @@ module Trustie
merge_requests_enabled: true,
public: false,
user_id: gid,
import_url: import_url
import_url: import_url,
visibility_level: project.is_public? ? UserLevel::PUBLIC : UserLevel::PRIVATE
)
puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
project.gpid = gproject.id