Errors in GitLab CI Pipeline Setup for Specmatic Integration #1098
-
"I have created a specmatic.json file within the consumer service and updated with central contract repository git URL. However, during the project build in the GitLab CI pipeline, I encountered an authentication error stating 'Authentication is required but no CredentialsProvider has been registered'. I attempted to provide the Git credentials through the CICD variables using the format https://$USERNAME:$PASSWORD@gitlab.com/git/central-contract.git. Despite this, I am still receive the same error, and it appears that these CICD variables are not being substituted during the build execution. I had a looked into similar discussion here #900 but I can't go in this direction. Any recommendation approach (documentation) from specmatic team, to get it done in Gitlab CI pipeline? Sample specmatic.json for reference {
"sources": [
{
"provider": "git",
"repository": "https://gitlab.com/git/specmatic/central-contract.git",
"branch": "modified-specs",
"test": [
"customer/customer.yaml"
],
"stub": [
"order/order.yaml"
]
}
]
} Thanks! UPDATE (by @harikrishnan83): Fixed link to related discussion |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Hello @gurubabujampala , thanks for reaching out. An access token needs to be setup and passed to Specmatic so that it can then clone your Central Contract Repo while running in CI. Here is the documentation on how we achieve this on Github actions. Also here is a complete workflow YAML file for your reference - workflow file. We will get back to you shortly with similar instructions for Gitlab. |
Beta Was this translation helpful? Give feedback.
-
hello @gurubabujampala, Specmatic now substitutes env variables that are part of the Git repo URL that you mention in |
Beta Was this translation helpful? Give feedback.
-
Hi @harikrishnan83, we are trying to use the bamboo pipeline for build we have set up the git lab access token in bamboo variables. Once we start to build we are getting the below error that token is not set. We are using the same token that is used for accessing the repo manually its working in that case. build 30-Oct-2024 07:38:07 Loading config file ./specmatic.json Do we need to follow some different steps to get the token while in bamboo pipeline? |
Beta Was this translation helpful? Give feedback.
hello @gurubabujampala, Specmatic now substitutes env variables that are part of the Git repo URL that you mention in
specmatic.json
. This is part of the latest release 1.3.18. Here is the link to the documentation. Hope this helps. Thanks.