From 63d215bb30d42fddf06de6ca4d01422fd42d19b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de>
Date: Tue, 2 Mar 2021 14:01:46 +0100
Subject: [PATCH] Integrate quarkus pipeline in root pipeline

---
 .gitlab-ci.yml                    | 73 +++++++++++++++++++++++++------
 theodolite-quarkus/.gitlab-ci.yml | 44 -------------------
 2 files changed, 59 insertions(+), 58 deletions(-)
 delete mode 100644 theodolite-quarkus/.gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1dd22c98f..b481d47c9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -175,13 +175,70 @@ deploy-uc4-load-generator:
 
 # Theodolite Framework
 
+.theodolite:
+  image: openjdk:11-jdk
+  tags:
+    - exec-docker
+  variables:
+    GRADLE_OPTS: "-Dorg.gradle.daemon=false"
+  cache:
+    paths:
+      - .gradle/wrapper
+      - .gradle/caches
+  before_script:
+    - cd theodolite-quarkus
+    - export GRADLE_USER_HOME=`pwd`/.gradle
+
+build-theodolite:
+  stage: build
+  extends: .theodolite
+  needs:
+    - build-benchmarks
+    - test-benchmarks
+  #script: ./gradlew --build-cache assemble -Dquarkus.package.type=native
+  script: ./gradlew --build-cache assemble
+  artifacts:
+    paths:
+      - "theodolite-quarkus/build/libs/*.jar"
+    expire_in: 1 day
+
+test-theodolite:
+  stage: test
+  extends: .theodolite
+  needs:
+    - build-benchmarks
+  script: ./gradlew test --stacktrace
+
+# Disabled for now
+.ktlint-theodolite:
+  stage: check
+  extends: .theodolite
+  needs:
+    - build-benchmarks
+    - test-benchmarks
+  script: ./gradlew ktlintCheck --continue
+
+# Disabled for now
+.detekt-theodolite: 
+  stage: check
+  extends: .theodolite
+  needs:
+    - build-benchmarks
+    - test-benchmarks
+  script: ./gradlew detekt --continue
+
 deploy-theodolite:
   stage: deploy
   extends:
+    - .theodolite
     - .dind
+  needs:
+    - build-theodolite
+    - test-theodolite
   script:
     - DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//')
-    - docker build --pull -t theodolite ./execution
+    #- docker build -f src/main/docker/Dockerfile.native -t theodolite .
+    - docker build -f src/main/docker/Dockerfile.jvm -t theodolite .
     - "[ ! $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:${DOCKER_TAG_NAME}latest"
     - "[ ! $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:$DOCKER_TAG_NAME$CI_COMMIT_SHORT_SHA"
     - "[ $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:$CI_COMMIT_TAG"
@@ -192,21 +249,9 @@ deploy-theodolite:
     - if: "$CR_HOST && $CR_ORG && $CR_USER && $CR_PW && $CI_COMMIT_TAG"
       when: always
     - changes:
-      - execution/**/*
+      - theodolite-quarkus/**/*
       if: "$CR_HOST && $CR_ORG && $CR_USER && $CR_PW"
       when: always
     - if: "$CR_HOST && $CR_ORG && $CR_USER && $CR_PW"
       when: manual
       allow_failure: true
-
-framework:
-  stage: triggers
-  trigger:
-    include: theodolite-quarkus/.gitlab-ci.yml
-    strategy: depend
-  rules:
-    - if: "$CI_COMMIT_TAG"
-    - changes:
-      - theodolite-quarkus/*
-    - when: manual
-      allow_failure: true
diff --git a/theodolite-quarkus/.gitlab-ci.yml b/theodolite-quarkus/.gitlab-ci.yml
deleted file mode 100644
index 916e0f903..000000000
--- a/theodolite-quarkus/.gitlab-ci.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-image: openjdk:11-jdk
-
-stages:
-  - build
-  - test
-  - check
-  #- package
-
-before_script:
-  - cd theodolite-quarkus
-  - export GRADLE_USER_HOME=`pwd`/.gradle
-
-cache:
-  paths:
-    - .gradle/wrapper
-    - .gradle/caches
-
-compile:
-  stage: build
-  tags:
-    - exec-docker
-  script:
-    - ./gradlew build
-
-test:
-  stage: test
-  tags:
-    - exec-docker
-  script:
-    - ./gradlew test --stacktrace
-
-.ktlint:
-  stage: check
-  tags:
-    - exec-docker
-  script:
-    - ./gradlew ktlintCheck --continue
-
-.detekt: 
-  stage: check
-  tags:
-    - exec-docker
-  script:
-     - ./gradlew detekt --continue
\ No newline at end of file
-- 
GitLab