LoginSignup
5
5

More than 5 years have passed since last update.

GitLab API | gitlab gem で 新規ユーザーの作成

Last updated at Posted at 2014-07-08

GitLab API | gitlab gem で 新規ユーザーの作成

概要

gitlab gem で 新規ユーザーの作成

サンプル

require 'gitlab'

Gitlab.configure do |config|
  config.endpoint       = 'http://some_path/api/v3' 
  config.private_token  = 'your token'
end
puts Gitlab.users.size # => この段階では 1(初期の管理者ユーザー分)
Gitlab.create_user('hoge@hogehoge_hige.jp', 'sample_pass', username: 'hoge')
Gitlab.create_user('hige@hogehoge_hige.jp', 'sample_pass', username: 'hige')
puts Gitlab.users.size # => この段階では 3

出力

1
3

補足

  • username は GitLab API の必須項目
  • name を指定しないと email が name として設定される

参照

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5