Merge branch 'Templates_v1' into 'master'
feat(*): initial Commit See merge request gilden/ci/gitlab-ci-templates!1
This commit is contained in:
commit
1bb8d20b58
74
.gitignore
vendored
Normal file
74
.gitignore
vendored
Normal file
@ -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
|
||||||
8
.idea/.gitignore
vendored
Normal file
8
.idea/.gitignore
vendored
Normal file
@ -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/
|
||||||
9
.idea/gitlab-ci-templates.iml
Normal file
9
.idea/gitlab-ci-templates.iml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
6
.idea/misc.xml
Normal file
6
.idea/misc.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/gitlab-ci-templates.iml" filepath="$PROJECT_DIR$/.idea/gitlab-ci-templates.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
3
.idea/sonarlint/issuestore/index.pb
Normal file
3
.idea/sonarlint/issuestore/index.pb
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
A
|
||||||
|
publish-image.yml,2/e/2eef21b10116aab77b6b014cb5adf007d2d2e128
|
||||||
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
README.adoc
Normal file
6
README.adoc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
ifndef::imagesdir[]
|
||||||
|
:imagesdir: documentation/images
|
||||||
|
endif::[]
|
||||||
|
|
||||||
|
include::documentation/document.adoc[]
|
||||||
|
|
||||||
33
STD-variablen-Template.yml
Normal file
33
STD-variablen-Template.yml
Normal file
@ -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
|
||||||
59
documentation/chapters/generalInformation.adoc
Normal file
59
documentation/chapters/generalInformation.adoc
Normal file
@ -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[]
|
||||||
|
----
|
||||||
15
documentation/chapters/templates/maven-build-template.adoc
Normal file
15
documentation/chapters/templates/maven-build-template.adoc
Normal file
@ -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[]
|
||||||
|
----
|
||||||
@ -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[]
|
||||||
|
----
|
||||||
15
documentation/chapters/templates/maven-verify-template.adoc
Normal file
15
documentation/chapters/templates/maven-verify-template.adoc
Normal file
@ -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[]
|
||||||
|
----
|
||||||
15
documentation/chapters/templates/npm-build-template.adoc
Normal file
15
documentation/chapters/templates/npm-build-template.adoc
Normal file
@ -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[]
|
||||||
|
----
|
||||||
@ -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[]
|
||||||
|
----
|
||||||
15
documentation/chapters/templates/npm-lint-template.adoc
Normal file
15
documentation/chapters/templates/npm-lint-template.adoc
Normal file
@ -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[]
|
||||||
|
----
|
||||||
15
documentation/chapters/templates/npm-test-template.adoc
Normal file
15
documentation/chapters/templates/npm-test-template.adoc
Normal file
@ -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[]
|
||||||
|
----
|
||||||
18
documentation/chapters/templates/publish-image.adoc
Normal file
18
documentation/chapters/templates/publish-image.adoc
Normal file
@ -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[]
|
||||||
|
----
|
||||||
17
documentation/chapters/templates/sonar-template.adoc
Normal file
17
documentation/chapters/templates/sonar-template.adoc
Normal file
@ -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[]
|
||||||
|
----
|
||||||
53
documentation/document.adoc
Normal file
53
documentation/document.adoc
Normal file
@ -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 <marcel.feix@exxcellent.de>
|
||||||
|
|
||||||
|
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]
|
||||||
0
documentation/images/.gitkeep
Normal file
0
documentation/images/.gitkeep
Normal file
10
maven-build-template.yml
Normal file
10
maven-build-template.yml
Normal file
@ -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
|
||||||
5
maven-dependencies-template.yml
Normal file
5
maven-dependencies-template.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.maven-dependencies:
|
||||||
|
stage: dependencies
|
||||||
|
image: $MAVEN_IMAGE
|
||||||
|
script:
|
||||||
|
- "mvn $MAVEN_CLI_OPTS dependency:resolve"
|
||||||
12
maven-verify-template.yml
Normal file
12
maven-verify-template.yml
Normal file
@ -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
|
||||||
11
npm-build-template.yml
Normal file
11
npm-build-template.yml
Normal file
@ -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/*
|
||||||
5
npm-dependencies-template.yml
Normal file
5
npm-dependencies-template.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.npm-dependencies:
|
||||||
|
image: $NODE_IMAGE
|
||||||
|
stage: dependencies
|
||||||
|
script:
|
||||||
|
- npm install
|
||||||
12
npm-lint-template.yml
Normal file
12
npm-lint-template.yml
Normal file
@ -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/*
|
||||||
8
npm-test-template.yml
Normal file
8
npm-test-template.yml
Normal file
@ -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
|
||||||
40
publish-image.yml
Normal file
40
publish-image.yml
Normal file
@ -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
|
||||||
Loading…
Reference in New Issue
Block a user