Skip to content

Instantly share code, notes, and snippets.

@owickstrom
Last active December 18, 2015 09:58
Show Gist options
  • Save owickstrom/5764752 to your computer and use it in GitHub Desktop.
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.
# gitlab 5.2.0 create user
# rake create_user["john@doe.com","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