Answer the question
In order to leave comments, you need to log in
How to add unit tests to gitlab-ci?
Gitlab-CI is building a build built on Docker containers. But you need to add a run of unit tests. Those. enter the container, run unit tests and, depending on the results, either stop the build or continue. How to determine the ID of the desired container in order to get into it?
Answer the question
In order to leave comments, you need to log in
And what prevents you from creating a test image, after successful tests, reupload this image to the prod version ?!
For example, a piece from a pipe:
Step 3:
stage: build
only:
- "master"
script:
- docker pull $IMAGE:${VERSION}_test
- docker tag $IMAGE:${VERSION}_test $IMAGE:latest
- docker tag $IMAGE:${VERSION}_test $IMAGE:$VERSION
- docker push $IMAGE:latest
- docker push $IMAGE:$VERSION
tags: [build]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question