2019-03-26 07:39:52 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-11-21 07:06:40 -05:00
|
|
|
require './spec/support/sidekiq_middleware'
|
2019-03-26 07:39:52 -04:00
|
|
|
|
2020-07-21 20:09:26 -04:00
|
|
|
# Create an api access token for root user with the value:
|
|
|
|
token = 'ypCa3Dzb23o5nvsixwPA'
|
|
|
|
scopes = Gitlab::Auth.all_available_scopes
|
|
|
|
|
2019-03-26 07:39:52 -04:00
|
|
|
Gitlab::Seeder.quiet do
|
2020-07-21 20:09:26 -04:00
|
|
|
User.find_by(username: 'root').tap do |user|
|
|
|
|
params = {
|
|
|
|
scopes: scopes.map(&:to_s),
|
|
|
|
name: 'seeded-api-token'
|
|
|
|
}
|
|
|
|
|
|
|
|
user.personal_access_tokens.build(params).tap do |pat|
|
|
|
|
pat.set_token(token)
|
|
|
|
pat.save!
|
|
|
|
end
|
|
|
|
end
|
2019-03-26 07:39:52 -04:00
|
|
|
|
|
|
|
print '.'
|
|
|
|
end
|