znsio / specmatic

Turn your contracts into executable specifications. Contract Driven Development - Collaboratively Design & Independently Deploy MicroServices & MicroFrontends.
https://specmatic.io
MIT License
275 stars 51 forks source link

Evaluate env var in git repo URL before running clone command #1108

Closed harikrishnan83 closed 4 months ago

harikrishnan83 commented 4 months ago

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:

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 as JGit.

Checklist:

Related Discussion

1098

nashjain commented 4 months ago

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