Skip to content
Snippets Groups Projects
Commit 3d69c9d0 authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Optimized pipeline

parent c1704f68
No related branches found
No related tags found
No related merge requests found
Pipeline #110911 failed
This commit is part of merge request !192. Comments created here will be created in the context of that merge request.
......@@ -2,7 +2,6 @@ stages:
- build
- test
- build_image
- test_build
- pages
- staging
......@@ -32,6 +31,8 @@ build_test_env:
- .venv
tags:
- docker
interruptible: true
build_frontend:
image: node:carbon
......@@ -54,6 +55,29 @@ build_frontend:
- frontend/node_modules/
tags:
- docker
interruptible: true
build_test_image:
image: docker:latest
stage: build
only:
- branches
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $DEV_IMAGE_BASE || true
- docker build --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE_BASE --target node .
- docker pull $DEV_IMAGE || true
- docker build --cache-from $DEV_IMAGE --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE .
- docker push $DEV_IMAGE_BASE
- docker push $DEV_IMAGE
tags:
- docker
interruptible: true
# ============================== Testing section ============================= #
# ----------------------------- Backend subsection --------------------------- #
......@@ -65,6 +89,9 @@ build_frontend:
- build_test_env
tags:
- docker
interruptible: true
needs:
- build_test_env
test_pytest:
<<: *test_definition_virtualenv
......@@ -97,6 +124,10 @@ test_flake8:
- build_frontend
tags:
- docker
interruptible: true
needs:
- build_frontend
- build_test_env
test_frontend:
<<: *test_definition_frontend
......@@ -124,37 +155,17 @@ test_frontend_unit:
script:
- cd frontend/
- yarn test:unit
interruptible: true
needs:
- build_frontend
# =========================== Build Image section ============================ #
build_dev_image:
image: docker:latest
stage: build_image
only:
- branches
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $DEV_IMAGE_BASE || true
- docker build --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE_BASE --target node .
- docker pull $DEV_IMAGE || true
- docker build --cache-from $DEV_IMAGE --cache-from $DEV_IMAGE_BASE -t $DEV_IMAGE .
- docker push $DEV_IMAGE_BASE
- docker push $DEV_IMAGE
tags:
- docker
build_release_image:
image: docker:latest
stage: build_image
only:
- tags
except:
- branches
services:
- docker:dind
variables:
......@@ -184,7 +195,9 @@ pages:
- public
only:
- master
interruptible: true
needs:
- test_pytest
# ============================== Staging section ============================= #
.staging_template: &staging_definition
......
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