Fixes deploy tokens build variables
It was using name, instead of username. Fixes documentation as well Closes #46454
This commit is contained in:
parent
ff944005c3
commit
dbe0839396
|
@ -661,7 +661,7 @@ module Ci
|
||||||
Gitlab::Ci::Variables::Collection.new.tap do |variables|
|
Gitlab::Ci::Variables::Collection.new.tap do |variables|
|
||||||
break variables unless gitlab_deploy_token
|
break variables unless gitlab_deploy_token
|
||||||
|
|
||||||
variables.append(key: 'CI_DEPLOY_USER', value: gitlab_deploy_token.name)
|
variables.append(key: 'CI_DEPLOY_USER', value: gitlab_deploy_token.username)
|
||||||
variables.append(key: 'CI_DEPLOY_PASSWORD', value: gitlab_deploy_token.token, public: false)
|
variables.append(key: 'CI_DEPLOY_PASSWORD', value: gitlab_deploy_token.token, public: false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Fixes deploy token variables on Ci::Build
|
||||||
|
merge_request: 19047
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -76,7 +76,7 @@ pull images from your Container Registry.
|
||||||
> [Introduced][ce-18414] in GitLab 10.8.
|
> [Introduced][ce-18414] in GitLab 10.8.
|
||||||
|
|
||||||
There's a special case when it comes to Deploy Tokens, if a user creates one
|
There's a special case when it comes to Deploy Tokens, if a user creates one
|
||||||
named `gitlab-deploy-token`, the name and token of the Deploy Token will be
|
named `gitlab-deploy-token`, the username and token of the Deploy Token will be
|
||||||
automatically exposed to the CI/CD jobs as environment variables: `CI_DEPLOY_USER` and
|
automatically exposed to the CI/CD jobs as environment variables: `CI_DEPLOY_USER` and
|
||||||
`CI_DEPLOY_PASSWORD`, respectively.
|
`CI_DEPLOY_PASSWORD`, respectively.
|
||||||
|
|
||||||
|
|
|
@ -2084,7 +2084,7 @@ describe Ci::Build do
|
||||||
|
|
||||||
let(:deploy_token_variables) do
|
let(:deploy_token_variables) do
|
||||||
[
|
[
|
||||||
{ key: 'CI_DEPLOY_USER', value: deploy_token.name, public: true },
|
{ key: 'CI_DEPLOY_USER', value: deploy_token.username, public: true },
|
||||||
{ key: 'CI_DEPLOY_PASSWORD', value: deploy_token.token, public: false }
|
{ key: 'CI_DEPLOY_PASSWORD', value: deploy_token.token, public: false }
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue