socialforge/lib/tasks/gitlab.rake

12 lines
335 B
Ruby
Raw Normal View History

2015-06-30 22:12:34 +08:00
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