Skip to content

Support group gitlab-deploy-token for CI_DEPLOY_ variables

Furkan Ayhan requested to merge 214014-group-gitlab-deploy-token-variable into master

What does this MR do and why?

When you define a deploy token with the name gitlab-deploy-token in a project, you get CI_DEPLOY_USER and CI_DEPLOY_PASSWORD variables in CI pipeline jobs. However, you don't get them when you define this deploy token at the group level. This MR will implement this.

The changes are behind a feature flag ci_variable_for_group_gitlab_deploy_token #363621 (closed)

Related to #214014 (closed)

Screenshots or screen recordings

  1. Create a deploy token with the name gitlab-deploy-token:

at http://gitlab/groups/my-group-name/-/settings/repository/deploy_token/create#js-deploy-tokens

Screen_Shot_2022-05-26_at_21.02.19

  1. Test this CI config in a project under that group to see if the variable is available:
test:
  script: echo $CI_DEPLOY_USER

Screen_Shot_2022-05-26_at_21.08.59

  1. Enable the feature flag and test it again:
Feature.enable(:ci_variable_for_group_gitlab_deploy_token)

Screen_Shot_2022-05-26_at_21.08.54

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marius Bobin

Merge request reports