From c0f98471fda4644d661a3b0ff0886d06dfdc7b57 Mon Sep 17 00:00:00 2001
From: "Langer, Jacek" <jacek.langer@tu-darmstadt.de>
Date: Fri, 1 Apr 2022 14:37:24 +0200
Subject: [PATCH] Update .gitlab-ci.yml file

---
 .gitlab-ci.yml | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e44cc5c..4225ba2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,12 +1,17 @@
 # Build and push the Docker image off of merges to master; based off
 # of Gitlab CI support in https://pythonspeed.com/products/pythoncontainer/
-docker-build:
-  stage: build
-
+default:
   image:
     # An alpine-based image with the `docker` CLI installed.
     name: docker:19.03.12
 
+stages:
+  - "build"
+  - "pull db container"
+
+docker-build:
+  stage: build
+
   # This will run a Docker daemon in a container (Docker-In-Docker), which will
   # be available at thedockerhost:2375. If you make e.g. port 5000 public in Docker
   # (`docker run -p 5000:5000 yourimage`) it will be exposed at thedockerhost:5000.
@@ -33,9 +38,16 @@ docker-build:
     - echo $CI_BUILD_TOKEN | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
     - docker build -t "$CI_REGISTRY_IMAGE" .
     - docker push "$CI_REGISTRY_IMAGE"
-    - docker pull registry.git-ce.rwth-aachen.de/etit/docker-test-images/ms-sql-docker-base:latest
-
-  # Only build off of master branch:
   only:
     - main
 
+Pull:
+  stage: "pull db container"
+  script:
+    - |
+      echo "login into registry.git-ce.rwth-aachen.de/etit/docker-test-images"
+      echo $CI_BUILD_TOKEN | docker login registry.git-ce.rwth-aachen.de/etit/docker-test-images -u $CI_REGISTRY_USER
+      echo "downloading scripts"
+      docker pull registry.git-ce.rwth-aachen.de/etit/docker-test-images/ms-sql-docker-base:latest
+  # Only build off of master branch:
+
-- 
GitLab