From 228379dd9a07fc2a5db2164c6258a47ca0c5077e Mon Sep 17 00:00:00 2001
From: Eduard Frankford <e.frankford@student.uibk.ac.at>
Date: Sun, 29 May 2022 10:57:25 +0200
Subject: [PATCH] run whole pipeline

---
 .gitlab-ci.yml                                | 181 +++++++++---------
 .../datapolicy/datapolicy.component.html      |   2 +-
 2 files changed, 91 insertions(+), 92 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8c78dcbc8..60728dd6c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,10 +5,10 @@ cache:
   paths:
     - .maven/
 stages:
-  # - lint
-  # - build
-  # - test
-  # - analyze
+  - lint
+  - build
+  - test
+  - analyze
   # - package
   - release
   - deploy
@@ -17,96 +17,96 @@ before_script:
   - export NG_CLI_ANALYTICS="false"
   - export MAVEN_USER_HOME=`pwd`/.maven
 
-# pmdCheckstylePrettierLint:
-#   stage: lint
-#   cache: {}
-#   when: always
-#   before_script:
-#     - 'export VERSION="6.40.0"'
-#     - 'wget "https://github.com/pmd/pmd/releases/download/pmd_releases%2F$VERSION/pmd-bin-$VERSION.zip"'
-#     - 'jar -xf "pmd-bin-$VERSION.zip"'
-#     - 'chmod u+x "pmd-bin-$VERSION/bin/run.sh"'
-#   script:
-#     - SUCCESS=true
-#     - echo "Running PMD"
-#     - '"pmd-bin-$VERSION/bin/run.sh" pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log || SUCCESS=false'
-#     - echo "Running checkstyle"
-#     - ./mvnw -ntp checkstyle:check -Dmaven.repo.local=$MAVEN_USER_HOME || SUCCESS=false
-#     - echo "Running prettier"
-#     - npm install
-#     - npm run prettier:check
-#     - echo "Running eslint"
-#     - 'npm run lint | tee lint.log'
-#     - "! grep -qE '✖ [0-9]+ problem' lint.log || SUCCESS=false"
-#     - $SUCCESS
-#   needs: []
-#   artifacts:
-#     when: on_failure
-#     expire_in: 30 days
-#     paths:
-#       - pmd.log
+pmdCheckstylePrettierLint:
+  stage: lint
+  cache: {}
+  when: always
+  before_script:
+    - 'export VERSION="6.40.0"'
+    - 'wget "https://github.com/pmd/pmd/releases/download/pmd_releases%2F$VERSION/pmd-bin-$VERSION.zip"'
+    - 'jar -xf "pmd-bin-$VERSION.zip"'
+    - 'chmod u+x "pmd-bin-$VERSION/bin/run.sh"'
+  script:
+    - SUCCESS=true
+    - echo "Running PMD"
+    - '"pmd-bin-$VERSION/bin/run.sh" pmd -d src/main/java -f textcolor -R pmd_rules.xml 2>&1 | tee pmd.log || SUCCESS=false'
+    - echo "Running checkstyle"
+    - ./mvnw -ntp checkstyle:check -Dmaven.repo.local=$MAVEN_USER_HOME || SUCCESS=false
+    - echo "Running prettier"
+    - npm install
+    - npm run prettier:check
+    - echo "Running eslint"
+    - 'npm run lint | tee lint.log'
+    - "! grep -qE '✖ [0-9]+ problem' lint.log || SUCCESS=false"
+    - $SUCCESS
+  needs: []
+  artifacts:
+    when: on_failure
+    expire_in: 30 days
+    paths:
+      - pmd.log
 
-# maven-compile:
-#   stage: build
-#   script:
-#     - ./mvnw -ntp compile -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME
-#   artifacts:
-#     paths:
-#       - target/classes/
-#       - target/generated-sources/
-#     expire_in: 10 days
-#   needs: []
+maven-compile:
+  stage: build
+  script:
+    - ./mvnw -ntp compile -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME
+  artifacts:
+    paths:
+      - target/classes/
+      - target/generated-sources/
+    expire_in: 10 days
+  needs: []
 
-# maven-test:
-#   # DinD service is required for Testcontainers
-#   services:
-#     - docker:20-dind
-#   variables:
-#     # Instruct Testcontainers to use the daemon of DinD.
-#     DOCKER_HOST: 'tcp://docker:2375'
-#     DOCKER_TLS_CERTDIR: ''
-#   stage: test
-#   script:
-#     - ./mvnw -ntp verify -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME -Dspring.profiles.active=testcontainers
-#   allow_failure: true
-#   artifacts:
-#     reports:
-#       junit:
-#         - target/surefire-reports/TEST-*.xml
-#         - target/failsafe-reports/TEST-*.xml
-#     paths:
-#       - target/surefire-reports
-#       - target/failsafe-reports
-#       - target/site
-#     when: always
-#     expire_in: 15 days
-#   needs: []
+maven-test:
+  # DinD service is required for Testcontainers
+  services:
+    - docker:20-dind
+  variables:
+    # Instruct Testcontainers to use the daemon of DinD.
+    DOCKER_HOST: 'tcp://docker:2375'
+    DOCKER_TLS_CERTDIR: ''
+  stage: test
+  script:
+    - ./mvnw -ntp verify -P-webapp -Dmaven.repo.local=$MAVEN_USER_HOME -Dspring.profiles.active=testcontainers
+  allow_failure: true
+  artifacts:
+    reports:
+      junit:
+        - target/surefire-reports/TEST-*.xml
+        - target/failsafe-reports/TEST-*.xml
+    paths:
+      - target/surefire-reports
+      - target/failsafe-reports
+      - target/site
+    when: always
+    expire_in: 15 days
+  needs: []
 
-# frontend-test:
-#   stage: test
-#   cache: {}
-#   script:
-#     - npm install
-#     - npm test
-#   artifacts:
-#     reports:
-#       junit: target/test-results/TESTS-results-jest.xml
-#     paths:
-#       - target/test-results
-#       - target/jacoco
-#     when: always
-#     expire_in: 15 days
-#   needs: []
+frontend-test:
+  stage: test
+  cache: {}
+  script:
+    - npm install
+    - npm test
+  artifacts:
+    reports:
+      junit: target/test-results/TESTS-results-jest.xml
+    paths:
+      - target/test-results
+      - target/jacoco
+    when: always
+    expire_in: 15 days
+  needs: []
 
-# sonar-analyze:
-#   stage: analyze
-#   dependencies:
-#     - maven-test
-#     - frontend-test
-#   script:
-#     - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://qe-sonarqube.uibk.ac.at/ -Dsonar.login=${SONAR_TOKEN_QE} -Dmaven.repo.local=$MAVEN_USER_HOME
-#   #    - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://server.arctis.at/sonar/ -Dsonar.login=${SONAR_TOKEN} -Dmaven.repo.local=$MAVEN_USER_HOME
-#   allow_failure: true
+sonar-analyze:
+  stage: analyze
+  dependencies:
+    - maven-test
+    - frontend-test
+  script:
+    - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://qe-sonarqube.uibk.ac.at/ -Dsonar.login=${SONAR_TOKEN_QE} -Dmaven.repo.local=$MAVEN_USER_HOME
+  #    - ./mvnw -ntp org.jacoco:jacoco-maven-plugin:prepare-agent initialize sonar:sonar -Dsonar.organization=codeAbility -Dsonar.host.url=https://server.arctis.at/sonar/ -Dsonar.login=${SONAR_TOKEN} -Dmaven.repo.local=$MAVEN_USER_HOME
+  allow_failure: true
 
 # maven-package:
 #   stage: package
@@ -123,7 +123,6 @@ docker-push:
     REGISTRY_URL: sharing-codeability.uibk.ac.at:5051
     IMAGE_TAG: sharing-codeability.uibk.ac.at:5051/sharing/codeability-sharing-platform
   script:
-    # - ./mvnw -ntp verify -Pprod -DskipTests -Dmaven.repo.local=$MAVEN_USER_HOME
     - ./mvnw package -Pprod verify -DskipTests jib:build -Djib.to.image=$IMAGE_TAG -Djib.to.auth.username=gitlab-ci-token  -Djib.to.auth.password=$CI_BUILD_TOKEN -Dmaven.repo.local=$MAVEN_USER_HOME
   when: always
 
diff --git a/src/main/webapp/app/layouts/datapolicy/datapolicy.component.html b/src/main/webapp/app/layouts/datapolicy/datapolicy.component.html
index 4cebf2fac..1e70fdf5f 100755
--- a/src/main/webapp/app/layouts/datapolicy/datapolicy.component.html
+++ b/src/main/webapp/app/layouts/datapolicy/datapolicy.component.html
@@ -12,7 +12,7 @@
       href="https://www.ris.bka.gv.at/GeltendeFassung.wxe?Abfrage=bundesnormen&amp;Gesetzesnummer=10001597"
       target="_blank"
       rel="external noopener noreferrer"
-      >österreichischen Datenschutzgesetz</a
+      >Österreichischen Datenschutzgesetz</a
     >.
   </p>
   <p>
-- 
GitLab