Run tests within docker Dockerfile
This commit is contained in:
parent
d137340da5
commit
a59e609d2c
|
|
@ -1,6 +1,5 @@
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build & test
|
||||||
- test
|
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
@ -11,7 +10,7 @@ variables:
|
||||||
DOCKER_DRIVER: overlay2
|
DOCKER_DRIVER: overlay2
|
||||||
|
|
||||||
kaniko:
|
kaniko:
|
||||||
stage: build
|
stage: build & test
|
||||||
image:
|
image:
|
||||||
name: gcr.io/kaniko-project/executor:debug
|
name: gcr.io/kaniko-project/executor:debug
|
||||||
entrypoint: [""]
|
entrypoint: [""]
|
||||||
|
|
@ -21,13 +20,6 @@ kaniko:
|
||||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/development/Dockerfile --destination $CI_REGISTRY_IMAGE/development --destination $CI_REGISTRY_IMAGE/development/commits:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE/development/branches:$CI_COMMIT_REF_SLUG
|
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/development/Dockerfile --destination $CI_REGISTRY_IMAGE/development --destination $CI_REGISTRY_IMAGE/development/commits:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE/development/branches:$CI_COMMIT_REF_SLUG
|
||||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/test/Dockerfile --destination $CI_REGISTRY_IMAGE/test --destination $CI_REGISTRY_IMAGE/test/commits:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE/test/branches:$CI_COMMIT_REF_SLUG
|
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/test/Dockerfile --destination $CI_REGISTRY_IMAGE/test --destination $CI_REGISTRY_IMAGE/test/commits:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE/test/branches:$CI_COMMIT_REF_SLUG
|
||||||
|
|
||||||
rails spec:
|
|
||||||
stage: test
|
|
||||||
image: registry.gitlab.com/turniere/turniere-backend/test
|
|
||||||
script:
|
|
||||||
- bundle exec rails db:migrate
|
|
||||||
- bundle exec rails spec
|
|
||||||
|
|
||||||
kubernetes:
|
kubernetes:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
only:
|
only:
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,5 @@ FROM registry.gitlab.com/turniere/turniere-backend/development
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN bundle install --deployment --with test
|
RUN bundle install --deployment --with test
|
||||||
ENV RAILS_ENV test
|
ENV RAILS_ENV test
|
||||||
CMD bundle exec rails db:migrate && bundle exec rails spec
|
RUN bundle exec rails db:migrate && bundle exec rails spec
|
||||||
|
CMD /bin/sh
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue