12 lines
335 B
Ruby
12 lines
335 B
Ruby
|
namespace :gitlab do
|
||
|
desc "sync users to gitlab"
|
||
|
task :sync => :environment do
|
||
|
User.where(login: 'guange').find_each do |user|
|
||
|
g = Gitlab.client
|
||
|
unless g.get("/users?search=#{user.mail}")
|
||
|
g.create_user(user.mail, user.hashed_password, name: user.show_name, username: user.login)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|