Last active
December 18, 2015 09:58
-
-
Save owickstrom/5764752 to your computer and use it in GitHub Desktop.
This is an update of https://gist.github.com/svanzoest/4028058 for Gitlab 5.2.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gitlab 5.2.0 create user | |
# rake create_user["[email protected]","johndoe","John Doe"] RAILS_ENV=production | |
desc "Create new user" | |
task :create_user, [:email, :username, :name] => :environment do |t, args| | |
puts "creating user '" + args.username + "' ('" + args.name + "') with email '" + args.email + "'" | |
@user = User.new({ email: args.email, name: args.name, username: args.username, force_random_password: true, projects_limit: 10 }, as: :admin) | |
if @user.save | |
puts "success" | |
else | |
puts "failed" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment