diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 57994e2665ce81d32d12a6e72785d86966f98216..a917effcf7ee57f3f50d569aa1f9b79cb639d63a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,16 +24,6 @@
 #
 
 variables:
-   SQL_RESTORE: ""
-   NIS_ENABLE: ""
-   NIS_DOMAIN: ""
-   NIS_SERVER: ""
-   PORT_SSL: ""
-   DOCKER_TZ: ""
-   DOCKER_MAIL: ""
-   MAKE_TEST: ""
-   MYSQL_ROOT_PASSWORD: caosdb1234
-   CI_REGISTRY_IMAGE: $CI_REGISTRY/caosdb
    # When using dind service we need to instruct docker, to talk with the
    # daemon started inside of the service. The daemon is available with
    # a network connection instead of the default /var/run/docker.sock socket.
@@ -59,10 +49,27 @@ variables:
 services:
    - docker:dind
 
-code_style:
-    script: "flake8 --count ."
+stages:
+    - deploy
+    - test
+    - style
 
+code_style:
+  stage: style
+  script: "flake8 --count ."
 
-services:
-  - name: mariadb:10.4
-  - name: "$CI_REGISTRY_IMAGE:latest"
+deploy-to-swarm:
+  stage: deploy
+  variables:
+    SERVICE_NAME: caosdb_stack
+  image: docker:latest
+  script:
+    - docker login -u testuser -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
+    - docker stack deploy 
+      --with-registry-auth 
+      --compose-file=.docker-stack-base.yml 
+      $SERVICE_NAME
+test:
+  stage: test
+  script: 
+    - echo "test"