diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-04-18 20:25:57 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-04-20 20:18:41 +0300 |
commit | 0dd6d25c251beffca510094281ac8403fad6d8d0 (patch) | |
tree | f84dc38b75693dc3752c3f2297c34566bd84ba2d /app/models | |
parent | f17e83653d9befc02ac0cbfe39a5e2be62cb40ef (diff) |
Rename special deploy token to make it more descriptive
Also:
- Includes more specs
- Improves a bit the documentation
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/build.rb | 2 | ||||
-rw-r--r-- | app/models/deploy_token.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 2a652b01313..f3972e0cd26 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -657,7 +657,7 @@ module Ci def deploy_token_variables Gitlab::Ci::Variables::Collection.new.tap do |variables| - variables.append(key: 'CI_DEPLOY_USER', value: DeployToken::GITLAB_DEPLOY_TOKEN) + variables.append(key: 'CI_DEPLOY_USER', value: DeployToken::GITLAB_DEPLOY_TOKEN_NAME) variables.append(key: 'CI_DEPLOY_PASSWORD', value: project.gitlab_deploy_token.token) end end diff --git a/app/models/deploy_token.rb b/app/models/deploy_token.rb index 191f07c527f..4e450d0bdc8 100644 --- a/app/models/deploy_token.rb +++ b/app/models/deploy_token.rb @@ -4,7 +4,7 @@ class DeployToken < ActiveRecord::Base add_authentication_token_field :token AVAILABLE_SCOPES = %i(read_repository read_registry).freeze - GITLAB_DEPLOY_TOKEN = 'gitlab-deploy-token'.freeze + GITLAB_DEPLOY_TOKEN_NAME = 'gitlab-deploy-token'.freeze default_value_for(:expires_at) { Forever.date } diff --git a/app/models/project.rb b/app/models/project.rb index a594f2df662..2684a02caba 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1881,7 +1881,7 @@ class Project < ActiveRecord::Base def gitlab_deploy_token @gitlab_deploy_token ||= - deploy_tokens.active.find_by(name: DeployToken::GITLAB_DEPLOY_TOKEN) + deploy_tokens.active.find_by(name: DeployToken::GITLAB_DEPLOY_TOKEN_NAME) end private |