Page MenuHomePhabricator

self-build/import registry.gitlab.com/gitlab-org/release-cli image
Open, LowPublic

Description

GitLab offers a release-cli image which helps create GitLab releases (release: section in .gitlab-ci.yml).

If we want to release trusted artifacts (built by Trusted Runners) we need to move release-cli image to our docker registry.

This was suggested in T320730#8420142

Event Timeline

LSobanski moved this task from Incoming to Backlog on the Collaboration-Services board.
LSobanski subscribed.

Leaving as is until we get an explicit request to implement.

For T392290 I’d like to release package versions from GitLab CI, and it sounds like this doesn’t work out of the box right now (a job with a release: stanza, as documented upstream, just yields "release-cli: command not found"), so consider this a request to implement :)

(This upstream issue, linking to this other one, suggests that it might be possible to work around this in the individual project’s CI, so I’ll probably experiment with that. But either way, it would be nice if it worked out of the box.)

(This upstream issue, linking to this other one, suggests that it might be possible to work around this in the individual project’s CI, so I’ll probably experiment with that. But either way, it would be nice if it worked out of the box.)

Okay, it looks like there are two possible workarounds, at least in my context:

  • Specify image: registry.gitlab.com/gitlab-org/release-cli in the job that’s to create the release (this probably doesn’t work in trusted runners?)
  • Manually download and invoke release-cli:
release-job:
  stage: release
  rules:
    - if: '$CI_COMMIT_TAG =~ /^v\d/'
  script:
    - mkdir -p ~/.local/bin
    - curl -L -o ~/.local/bin/release-cli https://gitlab.com/gitlab-org/release-cli/-/releases/v0.23.0/downloads/bin/release-cli-linux-amd64
    - chmod +x ~/.local/bin/release-cli
    - export PATH=$PATH:~/.local/bin
    - release-cli create --name="$CI_COMMIT_TAG" --tag-name="$CI_COMMIT_TAG" --description="$CI_COMMIT_TAG_MESSAGE"

This probably technically works in trusted runners but whether it’s acceptable is another question 😅