Answer the question
In order to leave comments, you need to log in
How to run tests using Docker socket binding?
Hello!
There are Gitlab CI and Gitlab CI Multi Runners. Now it is configured so that the tests are run through the shell executor on the machine where Gitlab CI Multi Runner is installed, the tests are run for the website in the root of the repository.
I tried all options docs.gitlab.com/ce/ci/docker/using_docker_build.html except, dind, and working only using docker private registry, you need to first build the image through the Dockerfile then push it to the registry and use this image when building . Example:
image: my-registry:5000/my-image:latest
before_script:
- yum -y update
- composer self-update
job:
script:
- composer install
- npm install
- ./node_modules/.bin/bower install
- ./php_packages/squizlabs/php_codesniffer/scripts/phpcs ...
- ./php_packages/sebastian/phpcpd/phpcpd ...
- npm test
image: docker:latest
before_script:
- docker info
build:
stage: build
script:
- docker build -t my-docker-image .
- docker run my-docker-image /script/to/run/tests
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question