Xeperis
Xeperis

Reputation: 1459

How to fail gitlab pipeline from docker container?

I run tests inside docker container on a shell runner (NodeJS/jest);

How can I fail gitlab pipeline if tests fail from inside the container?

Since all tests are http calls to other containers I also expect that after_script will work for tearing down the environment regardless of the outcome.

Upvotes: 0

Views: 624

Answers (1)

sytech
sytech

Reputation: 40861

When using docker compose, you'll need to use the --exit-code-from to specify the service that should be used for the exit code of the docker-compose command.

See also: https://stackoverflow.com/a/43367250/5747944

Upvotes: 1

Related Questions