From 19602f49c5f945ca0bb6b5182e821c10c9ee34fd Mon Sep 17 00:00:00 2001 From: Sijmen Schoon Date: Sun, 22 Mar 2020 00:33:13 +0100 Subject: [PATCH] Update gitlab-ci to split frontend and backend --- .gitlab-ci.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85c1d28..1223d31 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,14 +6,21 @@ stages: - build variables: - IMAGE: registry.gitlab.com/$CI_PROJECT_PATH + IMAGE_FRONTEND: "registry.gitlab.com/$CI_PROJECT_PATH/frontend:$CI_COMMIT_REF_SLUG" + IMAGE_BACKEND: "registry.gitlab.com/$CI_PROJECT_PATH/backend:$CI_COMMIT_REF_SLUG" + before_script: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com -build: +build-frontend: stage: build script: - - docker build --pull -t $IMAGE:master . - - docker push $IMAGE:master + - docker build --pull -t "$IMAGE_FRONTEND":master -f frontend/Dockerfile frontend/ + - docker push "$IMAGE_FRONTEND" +build-backend: + stage: build + script: + - docker build --pull -t "$IMAGE_BACKEND" -f backend/Dockerfile backend/ + - docker push "$IMAGE_BACKEND"