diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0a16fa7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,74 @@
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# AWS User-specific
+.idea/**/aws.xml
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/.idea/gitlab-ci-templates.iml b/.idea/gitlab-ci-templates.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/gitlab-ci-templates.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..639900d
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..b5124a3
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/sonarlint/issuestore/2/e/2eef21b10116aab77b6b014cb5adf007d2d2e128 b/.idea/sonarlint/issuestore/2/e/2eef21b10116aab77b6b014cb5adf007d2d2e128
new file mode 100644
index 0000000..e69de29
diff --git a/.idea/sonarlint/issuestore/index.pb b/.idea/sonarlint/issuestore/index.pb
new file mode 100644
index 0000000..201e7fb
--- /dev/null
+++ b/.idea/sonarlint/issuestore/index.pb
@@ -0,0 +1,3 @@
+
+A
+publish-image.yml,2/e/2eef21b10116aab77b6b014cb5adf007d2d2e128
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.adoc b/README.adoc
new file mode 100644
index 0000000..3010fb4
--- /dev/null
+++ b/README.adoc
@@ -0,0 +1,6 @@
+ifndef::imagesdir[]
+:imagesdir: documentation/images
+endif::[]
+
+include::documentation/document.adoc[]
+
diff --git a/README.md b/README.md
deleted file mode 100644
index d7b4e15..0000000
--- a/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Gitlab-CI-templates
-
diff --git a/STD-variablen-Template.yml b/STD-variablen-Template.yml
new file mode 100644
index 0000000..8ad409a
--- /dev/null
+++ b/STD-variablen-Template.yml
@@ -0,0 +1,33 @@
+stages:
+ - dependencies
+ - build
+ - test
+ - set-version
+ - publish
+ - post-process
+ - package
+
+cache:
+ key: "$CI_JOB_NAME"
+ paths:
+ - .m2/repository
+ - $FRONTEND_DIR/
+
+variables:
+ CI_REGISTRY: gitlab.exxcellent.de:4567
+ MAVEN_IMAGE: gitlab.exxcellent.de:4567/gilden/ci/exxcellent-java-maven-base-image:java11-maven3.8.1_latest
+ MAVEN_OPTS: >
+ -Dhttps.protocols=TLSv1.2
+ -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository
+ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN
+ -Dorg.slf4j.simpleLogger.showDateTime=true
+ -Djava.awt.headless=true
+ MAVEN_CLI_OPTS: >
+ --batch-mode
+ --errors
+ --fail-at-end
+ --show-version
+ -DinstallAtEnd=true
+ -DdeployAtEnd=true
+ SONAR_PROJECT_KEY: de.exxcellent.bwfps.csapp:csapp-middleware
+ FRONTEND_DIR: $CI_PROJECT_DIR
\ No newline at end of file
diff --git a/documentation/chapters/generalInformation.adoc b/documentation/chapters/generalInformation.adoc
new file mode 100644
index 0000000..2b47efc
--- /dev/null
+++ b/documentation/chapters/generalInformation.adoc
@@ -0,0 +1,59 @@
+:sourcedir: ../../
+= General Information
+
+Um die Templates in deinem Projekt zu benutzten musst du folgendes machen:
+
+1. `Include` das Template file in deinem `.gitlab-ci.yaml` File.
+2. Jetzt kannst du `extend` benutzen, um das Template zu integrieren.
+Es ist möglich weitere Veränderungen vorzunehmen.
+
+[source,yaml]
+----
+stages:
+ - test-image
+
+include:
+ - project: 'gilden/ci/gitlab-ci-templates'
+ ref: 'master'
+ file:
+ - 'maven-build-template.yml'
+ - 'maven-dependencies-template.yml'
+ - 'maven-verify-template.yml'
+ - 'npm-build-template.yml'
+ - 'npm-dependencies-template.yml'
+ - 'npm-lint-template.yml'
+ - 'npm-test-template.yml'
+ - 'publish-image.yml'
+ - 'set-version-template.yml'
+ - 'sonar-template.yml'
+
+
+test-image:
+ stage: test-image
+ extends: .build-image
+ when: manual
+ except:
+ - master
+ - tags
+ before_script:
+ - cd ImportantPath
+----
+
+[[Generel-Variablen]]
+== Generelle Variablen
+
+Bitte folgende Variablen in `.gitlab-ci.yaml` setzen
+
+|===
+|Name |Description
+|CI_REGISTRY| Registry der CI
+|MAVE_IMAGE| Das Image das benutzt werden soll für Jobs die Maven benötigen.
+|NODE_IMAGE| Das Image das benutzt werden soll für Jobs die NPM benötigen
+|MAVEN_OPTS| Generelle optionen um Maven zu verändern
+|MAVEN_CLI_OPTS| Optionen um Maven beim Bauen zu verbessern.
+|FRONTEND_DIR| Wenn das Projekt ein Frontend besitzt, muss der Pfad definiert werden, wo die note module gespeichert werden.
+|===
+
+----
+include::{sourcedir}/STD-variablen-Template.yml[]
+----
\ No newline at end of file
diff --git a/documentation/chapters/templates/maven-build-template.adoc b/documentation/chapters/templates/maven-build-template.adoc
new file mode 100644
index 0000000..1db46ab
--- /dev/null
+++ b/documentation/chapters/templates/maven-build-template.adoc
@@ -0,0 +1,15 @@
+:sourcedir: ../../../
+
+= maven-build-template
+
+Diese Template Baut die .jar Files und speichert die Ergebnisse als Artifact.
+
+.Variables
+|===
+|Name |Description | Default Value
+|===
+
+.mvn-build-template
+----
+include::{sourcedir}/maven-build-template.yml[]
+----
\ No newline at end of file
diff --git a/documentation/chapters/templates/maven-dependencies-template.adoc b/documentation/chapters/templates/maven-dependencies-template.adoc
new file mode 100644
index 0000000..ab8a4a3
--- /dev/null
+++ b/documentation/chapters/templates/maven-dependencies-template.adoc
@@ -0,0 +1,16 @@
+:sourcedir: ../../../
+
+= maven-dependencies-template
+
+Dieses Template läd die Maven Abhängigkeiten des Projekts runter.
+Bitte den Cache hinzufügen. Siehe xref:Generel-Veriablen[Generelle Veriablen]
+
+.Variables
+|===
+|Name |Description | Default Value
+|===
+
+.mvn-dependencies-template
+----
+include::{sourcedir}/maven-dependencies-template.yml[]
+----
\ No newline at end of file
diff --git a/documentation/chapters/templates/maven-verify-template.adoc b/documentation/chapters/templates/maven-verify-template.adoc
new file mode 100644
index 0000000..4852abf
--- /dev/null
+++ b/documentation/chapters/templates/maven-verify-template.adoc
@@ -0,0 +1,15 @@
+:sourcedir: ../../../
+
+= maven-verify-template
+
+Dieses Template startet `mvn verify` und speichert die Ergebnisse als Artifact.
+
+.Variables
+|===
+|Name |Description | Default Value
+|===
+
+.mvn-verify-template
+----
+include::{sourcedir}/maven-verify-template.yml[]
+----
\ No newline at end of file
diff --git a/documentation/chapters/templates/npm-build-template.adoc b/documentation/chapters/templates/npm-build-template.adoc
new file mode 100644
index 0000000..836bd49
--- /dev/null
+++ b/documentation/chapters/templates/npm-build-template.adoc
@@ -0,0 +1,15 @@
+:sourcedir: ../../../
+
+= npm-build-template
+
+Dieses Template baut das NPM projekt und speichert die Ergebnisse als Artifact..
+
+.Variables
+|===
+|Name |Description | Default Value
+|===
+
+.npm-build-template
+----
+include::{sourcedir}/npm-build-template.yml[]
+----
\ No newline at end of file
diff --git a/documentation/chapters/templates/npm-dependencies-template.adoc b/documentation/chapters/templates/npm-dependencies-template.adoc
new file mode 100644
index 0000000..340006d
--- /dev/null
+++ b/documentation/chapters/templates/npm-dependencies-template.adoc
@@ -0,0 +1,16 @@
+:sourcedir: ../../../
+
+= npm-dependencies-template
+
+Dieses Template läd die NPM Abhängigkeiten des Projekts runter.
+Bitte den Cache hinzufügen. Siehe xref:Generel-Veriablen[Generelle Veriablen]
+
+.Variables
+|===
+|Name |Description | Default Value
+|===
+
+.npm-dependencies-template
+----
+include::{sourcedir}/npm-dependencies-template.yml[]
+----
\ No newline at end of file
diff --git a/documentation/chapters/templates/npm-lint-template.adoc b/documentation/chapters/templates/npm-lint-template.adoc
new file mode 100644
index 0000000..8f89e87
--- /dev/null
+++ b/documentation/chapters/templates/npm-lint-template.adoc
@@ -0,0 +1,15 @@
+:sourcedir: ../../../
+
+= npm-lint-template
+
+Dieses Template durchläuft den Linter das NPM projekts.
+
+.Variables
+|===
+|Name |Description | Default Value
+|===
+
+.npm-lint-template
+----
+include::{sourcedir}/npm-lint-template.yml[]
+----
\ No newline at end of file
diff --git a/documentation/chapters/templates/npm-test-template.adoc b/documentation/chapters/templates/npm-test-template.adoc
new file mode 100644
index 0000000..109a82b
--- /dev/null
+++ b/documentation/chapters/templates/npm-test-template.adoc
@@ -0,0 +1,15 @@
+:sourcedir: ../../../
+
+= npm-test-template
+
+Dieses Template baut das NPM projekt.
+
+.Variables
+|===
+|Name |Description | Default Value
+|===
+
+.npm-test-template
+----
+include::{sourcedir}/npm-test-template.yml[]
+----
\ No newline at end of file
diff --git a/documentation/chapters/templates/publish-image.adoc b/documentation/chapters/templates/publish-image.adoc
new file mode 100644
index 0000000..2c2fa41
--- /dev/null
+++ b/documentation/chapters/templates/publish-image.adoc
@@ -0,0 +1,18 @@
+:sourcedir: ../../../
+
+= Publish-Image-jib
+
+Baut mithilfe von jib ein Docker Image und läd es in der Docker Registry des Projekt hoch.
+Dieser Schritt wird nur ausgeführt, wenn ein Tag gesetzt wird.
+
+.Variables
+|===
+|Name |Description | Default Value
+|MVN_VERSION | Bestimmt, ob die version von MAVEN gesetzt werden soll.
+Falls das Projekt aus mehreren Poms besteht, kann `bevor_script:` benutzt werden. | "true"
+|===
+
+.sonar-template
+----
+include::{sourcedir}/publish-image.yml[]
+----
\ No newline at end of file
diff --git a/documentation/chapters/templates/sonar-template.adoc b/documentation/chapters/templates/sonar-template.adoc
new file mode 100644
index 0000000..dd5e6d7
--- /dev/null
+++ b/documentation/chapters/templates/sonar-template.adoc
@@ -0,0 +1,17 @@
+:sourcedir: ../../../
+
+= sonar-template
+
+Ruft den Sonar Job für das Projekt auf.
+Mehr Details zu finden hier: https://gitlab.exxcellent.de/gilden/ci/exxcellent-sonar-tool[Gilde CI/CD: exxcellent-sonar-tool].
+
+.Variables
+|===
+|Name |Description | Default Value
+|SONAR_PROJECT_KEY | Der Sonar-Projekt-Key. | ""
+|===
+
+.sonar-template
+----
+include::{sourcedir}/sonar-template.yml[]
+----
\ No newline at end of file
diff --git a/documentation/document.adoc b/documentation/document.adoc
new file mode 100644
index 0000000..65a24ae
--- /dev/null
+++ b/documentation/document.adoc
@@ -0,0 +1,53 @@
+= Gitlab - Ci - Templates
+// #########################################################################
+// Die folgende Zeile NICHT ändern. Keine Leerzeilen einfügen!
+// Hier fügt das eXXcellent-documentation-tool Metadaten zur Build-Zeit ein
+// #########################################################################
+###exxcellent_base_template_placeholder###
+// ##########################################################################
+// Hinter :imagesdir: den relavtiven Pfad zu dem Ordner angeben, an dem alle Images der *.adoc files liegen.
+// Am besten den vorgegebenen Ordner 'images' einfach so lassen und verwenden.
+// ##########################################################################
+ifndef::imagesdir[]
+:imagesdir: images
+endif::[]
+// ##########################################################################
+// Bei Bedarf anpassen
+// Dokumentenklassifizierung = Öffentlich, Intern, Vertraulich, Streng vertraulich
+// ##########################################################################
+:revnumber: 1.0
+:classification: Intern
+:author: Marcel Feix
+
+Diese Repository enthält alle generellen CI Templates der CI Gilde.
+Templates für Tools werden in den Repositorys der Tools gepflegt.
+
+
+// ###########################################################################
+// Das Inhaltsverzeichnis ist nur im generierten HTML/PDF sichtbar (immer an erster Stelle, technisch bedingt)
+// ###########################################################################
+toc::[]
+
+// ###########################################################################
+// Attribut leveloffset addiert die gegebene Zahl zu den Überschriften im Dokument
+// Alle Überschriften erscheinen also eine Ebene tiefer
+// ###########################################################################
+include::chapters/generalInformation.adoc[leveloffset=1]
+
+== Misc Templates
+
+include::chapters/templates/sonar-template.adoc[leveloffset=1]
+include::chapters/templates/publish-image.adoc[leveloffset=1]
+
+== NPM Templates
+
+include::chapters/templates/npm-dependencies-template.adoc[leveloffset=1]
+include::chapters/templates/npm-build-template.adoc[leveloffset=1]
+include::chapters/templates/npm-lint-template.adoc[leveloffset=1]
+include::chapters/templates/npm-test-template.adoc[leveloffset=1]
+
+== Maven Templates
+
+include::chapters/templates/maven-dependencies-template.adoc[leveloffset=1]
+include::chapters/templates/maven-build-template.adoc[leveloffset=1]
+include::chapters/templates/maven-verify-template.adoc[leveloffset=1]
\ No newline at end of file
diff --git a/documentation/images/.gitkeep b/documentation/images/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/maven-build-template.yml b/maven-build-template.yml
new file mode 100644
index 0000000..bdccbe2
--- /dev/null
+++ b/maven-build-template.yml
@@ -0,0 +1,10 @@
+.maven-build:
+ stage: build
+ image: $MAVEN_IMAGE
+ script:
+ - mvn $MAVEN_CLI_OPTS clean package -DskipTests
+ artifacts:
+ expire_in: 2 weeks
+ when: always
+ paths:
+ - $BACKEND_DIR/target/*.jar
\ No newline at end of file
diff --git a/maven-dependencies-template.yml b/maven-dependencies-template.yml
new file mode 100644
index 0000000..3f938a4
--- /dev/null
+++ b/maven-dependencies-template.yml
@@ -0,0 +1,5 @@
+.maven-dependencies:
+ stage: dependencies
+ image: $MAVEN_IMAGE
+ script:
+ - "mvn $MAVEN_CLI_OPTS dependency:resolve"
\ No newline at end of file
diff --git a/maven-verify-template.yml b/maven-verify-template.yml
new file mode 100644
index 0000000..8104905
--- /dev/null
+++ b/maven-verify-template.yml
@@ -0,0 +1,12 @@
+.maven-test:
+ image: $MAVEN_IMAGE
+ stage: test
+ allow_failure: true
+ script:
+ - mvn $MAVEN_CLI_OPTS verify
+ artifacts:
+ expire_in: 2 weeks
+ reports:
+ junit:
+ - $BACKEND_DIR/target/surefire-reports/TEST-*.xml
+ - $BACKEND_DIR/target/failsafe-reports/TEST-*.xml
\ No newline at end of file
diff --git a/npm-build-template.yml b/npm-build-template.yml
new file mode 100644
index 0000000..86e939c
--- /dev/null
+++ b/npm-build-template.yml
@@ -0,0 +1,11 @@
+.npm-build:
+ image: $NODE_IMAGE
+ stage: build
+ script:
+ - npm install
+ - npm run build
+ artifacts:
+ expire_in: 2 weeks
+ when: always
+ paths:
+ - dist/*
\ No newline at end of file
diff --git a/npm-dependencies-template.yml b/npm-dependencies-template.yml
new file mode 100644
index 0000000..0980d89
--- /dev/null
+++ b/npm-dependencies-template.yml
@@ -0,0 +1,5 @@
+.npm-dependencies:
+ image: $NODE_IMAGE
+ stage: dependencies
+ script:
+ - npm install
diff --git a/npm-lint-template.yml b/npm-lint-template.yml
new file mode 100644
index 0000000..f9562b2
--- /dev/null
+++ b/npm-lint-template.yml
@@ -0,0 +1,12 @@
+.npm-lint:
+ image: $NODE_IMAGE
+ stage: test
+ before_script:
+ script:
+ - npm install -g eslint
+ - npm run lint
+# artifacts: todo add lint results in artifact if posible
+# expire_in: 2 weeks
+# when: always
+# paths:
+# - dist/*
\ No newline at end of file
diff --git a/npm-test-template.yml b/npm-test-template.yml
new file mode 100644
index 0000000..34d4948
--- /dev/null
+++ b/npm-test-template.yml
@@ -0,0 +1,8 @@
+.npm-test:
+ image: $NODE_IMAGE
+ stage: test
+ before_script:
+ - npm install -g rimraf karma
+ script:
+ - cd $FRONTEND_DIR
+ - npm run test-ci
\ No newline at end of file
diff --git a/publish-image.yml b/publish-image.yml
new file mode 100644
index 0000000..5abb8a8
--- /dev/null
+++ b/publish-image.yml
@@ -0,0 +1,40 @@
+.publish-image-jib:
+ image: $MAVEN_IMAGE
+ stage: package
+ only:
+ - tags
+ variables:
+ MVN_VERSION: "true"
+ script:
+ - export PARSED_VERSION=$(echo $CI_COMMIT_TAG | sed -r 's/\+/_/g') # Replace + sign since this is not valid in a docker tag
+ - echo $PARSED_VERSION
+ - >
+ if [ "${MVN_VERSION}" == "true" ]; then
+ mvn versions:set -DnewVersion=$PARSED_VERSION -DgenerateBackupPoms=false
+ fi
+ - mvn $MAVEN_CLI_OPTS compile jib:build
+ "-DskipTests"
+ "-Djib.to.auth.username=$CI_REGISTRY_USER"
+ "-Djib.to.auth.password=$CI_REGISTRY_PASSWORD"
+
+.publish-image-kaniko:
+ image:
+ name: gcr.io/kaniko-project/executor:debug
+ entrypoint: [ "" ]
+ stage: package
+ rules:
+ - if: $CI_COMMIT_TAG
+ variables:
+ DOCKER_REGISTRY: $CI_REGISTRY
+ DOCKER_REGISTRY_USER: $CI_REGISTRY_USER
+ DOCKER_REGISTRY_PASSWORD: $CI_REGISTRY_PASSWORD
+ PROJECT_DIR: $CI_PROJECT_DIR
+ DOCKERFILE_LOCATION: $CI_PROJECT_DIR/Dockerfile
+ CONTEXT_LOCATION: $CI_PROJECT_DIR
+ before_script:
+ - export PARSED_VERSION=$(echo $CI_COMMIT_TAG | sed -r 's/\+/_/g') # Replace + sign since this is not valid in a docker tag
+ - export IMAGE_NAME=$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
+ script:
+ - mkdir -p /kaniko/.docker
+ - echo "{\"auths\":{\"$DOCKER_REGISTRY\":{\"username\":\"$DOCKER_REGISTRY_USER\",\"password\":\"$DOCKER_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
+ - /kaniko/executor --context $CONTEXT_LOCATION --dockerfile $DOCKERFILE_LOCATION --destination $IMAGE_NAME --skip-tls-verify