Run test within docker-in-docker container

This commit is contained in:
Daniel Schädler 2019-06-20 21:36:54 +02:00
parent ae04eb0a87
commit a305a838fd
1 changed files with 10 additions and 3 deletions

View File

@ -3,6 +3,13 @@ stages:
- test - test
- deploy - deploy
services:
- docker:dind
variables:
DOCKER_HOST: tcp://localhost:2375/
DOCKER_DRIVER: overlay2
kaniko: kaniko:
stage: build stage: build
image: image:
@ -16,10 +23,10 @@ kaniko:
rails spec: rails spec:
stage: test stage: test
image: $CI_REGISTRY_IMAGE/test/commits:$CI_COMMIT_SHA image: docker:stable
script: script:
- bundle exec rails db:migrate RAILS_ENV=test - docker info
- bundle exec rails spec - docker run $CI_REGISTRY_IMAGE/test/commits:$CI_COMMIT_SHA
kubernetes: kubernetes:
stage: deploy stage: deploy