diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d95224d1..3a1ac49a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -107,6 +107,67 @@ push frontend image: # - docker image tag - docker push frontend +backend image: + stage: build images + script: + # TODO: define make target for this? + - make -- --docker-build-backend-build FRADRIVE_SERVICE=backend + - docker image save backend | gzip > docker/backend/image.tar.gz + artifacts: + paths: + - docker/backend/image.tar.gz + +backend build: + stage: compile + needs: + - job: backend image + artifacts: true + - job: frontend build + artifacts: true + script: + - &load-backend-image zcat docker/backend/image.tar.gz | docker image load + - make -- --docker-run-backend-build FRADRIVE_SERVICE=backend + artifacts: + paths: + - /fradrive/.stack/ + - /fradrive/.stack-work/ + +backend lint: + stage: lint + needs: + - job: backend image + artifacts: true + script: + - *load-backend-image + - make -- --docker-run-backend-lint FRADRIVE_SERVICE=backend + cache: *backend-cache + +backend test: + stage: test + needs: + - job: backend image + artifacts: true + - job: backend build + artifacts: true + script: + - *load-backend-image + - make -- --docker-run-backend-test FRADRIVE_SERVICE=backend + + cache: *backend-cache + +push backend image: + stage: push images + needs: + - job: backend image + artifacts: true + - job: backend build + artifacts: false + - job: backend test + artifacts: false + script: + - *load-backend-image + - docker push backend + # frontend dependencies: # stage: setup # cache: