1

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.

  • Welcome to Stack Overflow. Please read how to ask good [questions](https://stackoverflow.com/help/how-to-ask). Make sure your question covers these 3 elements: 1. Problem Statement 2. Your Code (it should be [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) 3. Error Message (preferably full Traceback to help others review and provide feedback). Sometimes the same question may have already been asked. Make sure your question is not a [duplicate](https://stackoverflow.com/help/duplicates) – Joe Ferndz Jan 09 '21 at 07:27
  • Hi! Is it really important for you to put test results to the same git repo? Wouldn't it be better and easier to upload it to some S3 bucket and share the URL to the remote file in the additional "notify" step of your pipeline? – Alik Khilazhev Jan 09 '21 at 13:26

0 Answers0