Evaluate env var in git repo URL before running clone command
Why:
With private central contract repositories, in order to allow Specmatic to clone the repo for Contract Testing and Stubbing in CI pipelines, in some scenarios we need authentication information to be provided as part of Git Repo URI. Examples:
As discussed @harikrishnan83 let's change this to make it uniform across gitlab, GitHub, ADO and other providers. We standardise on providing username/pwd or PAT or gitlab-ci-token in the URL
What:
Evaluate env var in git repo URL before running clone command
Why:
With private central contract repositories, in order to allow Specmatic to clone the repo for Contract Testing and Stubbing in CI pipelines, in some scenarios we need authentication information to be provided as part of Git Repo URI. Examples:
https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/group/project.git
https://${USER_NAME}:${PASSWORD}@gitlab.com/group/project.git
These env vars in these repository URLs in
specmatic.json
need to be evaluated before the clone command is run. Otherwise authentication will fail.How:
Right now it is a simple find and replace approach which is being done in both
SystemGit
as well asJGit
.Checklist:
Related Discussion
1098