Last active
September 5, 2017 05:41
-
-
Save mRoca/2ad2aee19a6aac94a731 to your computer and use it in GitHub Desktop.
gitlab-ci with docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/gitlab-runner/config.toml | |
concurrent = 2 | |
[[runners]] | |
name = "Nginx php5-fpm" | |
url = "http://git.domain.name/ci" | |
token = "e5cea98e2c848c8c0bebd019cee7f0" | |
limit = 1 | |
executor = "docker" | |
[runners.docker] | |
image = "olegpuzanov/docker-nginx-php5-fpm" | |
privileged = false | |
volumes = ["/cache"] | |
[[runners]] | |
name = "Docker in Docker" | |
url = "http://git.domain.name/ci" | |
token = "6238924d052a89c5adb7b949da126f" | |
limit = 1 | |
executor = "docker" | |
[runners.docker] | |
image = "gitlab/dind:latest" | |
privileged = true | |
volumes = ["/cache"] | |
allowed_images = ["mroca/symfony-test"] | |
allowed_services = ["mysql:*", "redis:*", "mongo:*"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/gitlab-runner/config.toml | |
concurrent = 1 | |
[[runners]] | |
url = "http://git.domain.name/ci" | |
token = "c942800ca6b65f5ba2a0a4a60e5e97" | |
name = "main" | |
executor = "docker" | |
[runners.docker] | |
image = "gitlab/dind:latest" | |
privileged = false | |
volumes = ["/cache"] | |
allowed_images = ["*", "*/*", "*/*/*"] | |
allowed_services = ["*", "*/*"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO add the docker volume dir in /cache | |
before_script: | |
- docker info | |
- docker build -t thom-platine/tests tests/docker/ | |
- docker run --name thom-platine-tests -v $(pwd):/var/www/ -v /cache:/cache -e "COMPOSER_CACHE_DIR=/cache/composer" -d thom-platine/tests tail -f /dev/null | |
- docker exec thom-platine-tests composer install --no-interaction | |
stages: | |
- test | |
behat: | |
stage: test | |
script: | |
- docker exec thom-platine-tests bin/behat | |
tags: | |
- docker | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: mroca/symfony-test | |
before_script: | |
- export COMPOSER_CACHE_DIR=/cache/composer | |
- composer install --no-interaction | |
stages: | |
- test | |
behat: | |
stage: test | |
script: | |
- bin/behat | |
tags: | |
- docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment