Skip to content
Snippets Groups Projects

Refactor

Merged Jan Maximilian Michal requested to merge refactor into master
1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
+ 31
6
stages:
stages:
- build
- build
- test
- test
@@ -7,7 +6,8 @@ stages:
@@ -7,7 +6,8 @@ stages:
variables:
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
build:
# ============================= Building section ============================= #
 
build_backend:
image: docker:latest
image: docker:latest
stage: build
stage: build
script:
script:
@@ -15,25 +15,50 @@ build:
@@ -15,25 +15,50 @@ build:
- docker build -t $IMAGE_TAG .
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
- docker push $IMAGE_TAG
# ============================== Testing section ============================= #
.test_template: &test_definition
# ----------------------------- Backend subsection --------------------------- #
 
.test_template_backend: &test_definition_backend
stage: test
stage: test
image: $IMAGE_TAG
image: $IMAGE_TAG
 
before_script:
 
- cd backend/
test_coverage:
test_coverage:
<<: *test_definition
<<: *test_definition_backend
services:
services:
- postgres:9.5
- postgres:9.5
script:
script:
- coverage run manage.py test --noinput
- coverage run manage.py test --noinput
- coverage report --skip-covered
- coverage report --skip-covered
 
artifacts:
 
paths:
 
- .coverage/
test_pylint:
test_pylint:
<<: *test_definition
<<: *test_definition_backend
script:
script:
- pylint core || exit 0
- pylint core || exit 0
 
test_prospector:
 
<<: *test_definition_backend
 
script:
 
- prospector --uses django || exit 0
 
 
# ----------------------------- Frontend subsection -------------------------- #
 
.test_template_frontend: &test_definition_frontend
 
image: node:carbon
 
stage: test
 
before_script:
 
- cd frontend/
 
 
test_frontend:
 
<<: *test_definition_frontend
 
script:
 
- yarn install
 
- yarn test --single-run
 
allow_failure: true
 
# ============================== Staging section ============================= #
.staging_template: &staging_definition
.staging_template: &staging_definition
stage: staging
stage: staging
image: docker:latest
image: docker:latest
Loading