QUESTION:

I'm encountering an issue with Gitlab's CI.
I managed to install the vendor locally with these credentials, however, when using Gitlab’s CI, I get an authentication error as follows:

[RuntimeException]                                                                                                                                                                  
Failed to execute git clone --no-checkout 'https://bss_composer@bitbucket.org/bsssupport/package_m2_magento2-guest-to-customer.git' '/builds/project/vendor/bsscommerce/guest-to-customer' && cd '/builds/project/vendor/bsscommerce/guest-to-customer' && git remote add composer 'https://bss_composer@bitbucket.org/bsssupport/package_m2_magento2-guest-to-customer.git' && git fetch composer && git remote set-url origin 'https://bss_composer@bitbucket.org/bsssupport/package_m2_magento2-guest-to-customer.git' && git remote set-url composer 'https://bss_composer@bitbucket.org/bsssupport/package_m2_magento2-guest-to-customer.git'


Cloning into '/builds/project/vendor/bsscommerce/guest-to-customer'...
remote: Invalid username or password
fatal: Authentication failed for 'https://bss_composer@bitbucket.org/bsssupport/package_m2_magento2-guest-to-customer.git/'

Small precision: the credentials have been added to the auth.json file.


After debugging a little, it seems like your repository tries to access it from bitbucket, which requires a bitbucket account.

Isn’t there a way to bypass that?


ANSWER:

The issue above due to the fact that BSS Composer is not familiar with Gitlab-CI.


To solve the issue, please do as steps below:

1. Config cache for composer https://gist.github.com/prog/b716b815ed4ec05d8ca57adc90be9e97 

2. Config repository URL including Basic Authentication information following:

composer config repositories.bsscommerce composer https://<public_key>:<private_key>@composer.bsscommerce.com/community


If you need further assistance, please do not hesitate to leave us a message via https://bsscommerce.com/contact.

We'd be happy to support!