We are using GitLab Enterprise Edition 13.4.3-ee and the composer package registry. Publishing to the registry in a CI step with authentication via $CI_JOB_TOKEN
works fine. However composer install on a depending project fails with “Invalid credentials”.
What I have done in the depending project:
Adding the registry to the repositories section with {servername} and {groupId} replaced by the actual values:
"repositories": [
{
"type": "composer",
"url": "https://{servername}/api/v4/group/{groupId}/-/packages/composer/packages.json"
},
...
Add the domain to the config section:
"config": {
"gitlab-domains": ["{servername}"],
...
Add the JobToken in the .gitlab-ci.yaml
before the composer install:
before_script:
- composer config gitlab-token.{servername} $CI_JOB_TOKEN
- composer install --no-progress -o
Am I missing anything? It works fine if I use a personal Access Token with exactly the same setup.