From df2872516af6fc2a246593d89690178b9de8de79 Mon Sep 17 00:00:00 2001
From: clemens <cwalter@ethz.ch>
Date: Thu, 16 Jan 2025 14:46:58 +0000
Subject: [PATCH] deployment

---
 .gitlab-ci.yml | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 195d65e..8b4611d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,7 +7,48 @@
 # See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
 stages:
 - test
+- build
+- deploy
+
 sast:
   stage: test
 include:
 - template: Security/SAST.gitlab-ci.yml
+
+build_master:
+  stage: build
+  image: docker:stable
+  services:
+    - docker:dind
+  before_script:
+    - echo "$CI_DOCKER_REGISTRY_TOKEN" | docker login -u "$CI_DOCKER_REGISTRY_USER" --password-stdin
+  script:
+    - docker build --pull -t "$CI_REGISTRY_IMAGE" ./
+    - docker push "$CI_REGISTRY_IMAGE"
+  environment:
+    name: production
+    url: https://qtool2.amiv.ethz.ch
+  only:
+    - main
+
+
+build_dev:
+  stage: build
+  image: docker:stable
+  services:
+    - docker:dind
+  before_script:
+    - echo "$CI_DOCKER_REGISTRY_TOKEN_DEV" | docker login -u "$CI_DOCKER_REGISTRY_USER_DEV" --password-stdin
+  script:
+    - docker build --pull -t "$CI_REGISTRY_IMAGE_DEV" ./
+    - docker push "$CI_REGISTRY_IMAGE_DEV"
+  environment:
+    name: development
+    url: https://qtool2-dev.amiv.ethz.ch
+
+deploy:
+  stage: deploy
+  image: amiveth/ansible-ci-helper
+  script:
+    - python /main.py
+
-- 
GitLab