Skip to content
Snippets Groups Projects
Commit 0cbc0348 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Refactor gitlab-ci

- Use gitlab-ci services instead of docker-compose to run postgres and
  redis
- Switch to docker socket
parent 4f8acf85
No related branches found
No related tags found
No related merge requests found
......@@ -2,15 +2,15 @@ image: docker:latest
.runner_tags: &runner_tags
tags:
- dind
services:
- docker:dind
- docker
variables:
CONTAINER_TEST_IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
CONTAINER_RELEASE_IMAGE: "$CI_REGISTRY_IMAGE:latest"
CONTAINER_CACHE_IMAGE: "$CI_REGISTRY_IMAGE:master"
POSTGRES_USER: ics
POSTGRES_PASSWORD: icspwd
POSTGRES_DB: csentry_db_test
stages:
- build
......@@ -32,18 +32,13 @@ build:
test:
<<: *runner_tags
stage: test
before_script:
- apk add --update py-pip
- pip install docker-compose
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
image: "$CONTAINER_TEST_IMAGE"
services:
- postgres:10
- redis:4.0
before_script: []
script:
- docker pull "$CONTAINER_TEST_IMAGE"
- docker-compose -f docker-compose.yml up -d postgres redis
- sleep 5
- docker-compose -f docker-compose.yml run --rm web
after_script:
- docker rm -f csentry_postgres
- docker rm -f csentry_redis
- pytest --cov=app -v
release-image:
<<: *runner_tags
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment