I have a Gitlab repository holding a .net core application. I have developed a CI script that publishes the application in three stages:
- Build: will compile an application into a docker image and save it for testing.
- Test: will run a set of tests in the docker image and export results to a file.
- Publish: if tests are successful, it will publish the compiled image.
What I want is to save the test results file in the Gitlab repository for example in a path /CI-tests
This allow me to have documentation of the test scripts that were executed.
I read in this question: How to copy files from dockerfile to host? That it is possible to copy the files from the docker container to the host, but I am not sure if it applies to the Gitlab repo.
And also I am concerned that extracting a file to the repo, will generate an additional commit that will trigger again the CI pipeline in an endless loop.
To be more precise, after a commit, I will be building the source code and running with Newman a Postman collection and I want to save the generated report back in the Git repository as a proof of success.