docs(Dind): Add template-printer for simpler printing of the templates and include

This commit is contained in:
Marcel Feix 2022-06-14 19:08:01 +02:00
parent a34f3ba24d
commit d0c6f86e33
No known key found for this signature in database
GPG Key ID: 04D016E104A25F03
29 changed files with 73 additions and 192 deletions

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates
= Ansible Template = Ansible Template
A Template Collection to simplify the deployment automation with Ansible. A Template Collection to simplify the deployment automation with Ansible.
@ -29,8 +27,5 @@ Use the Gitlab CI variables so not everyone has access to this Secret. Only Main
|EXTRA_ARGS | Additional Arguments that will be used from Ansible | "" |EXTRA_ARGS | Additional Arguments that will be used from Ansible | ""
|=== |===
.Ansible Collection :template: IaC/ansible.gitlab-ci.yml
[source,yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}/IaC/ansible.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates
= Docker-Compose Template = Docker-Compose Template
.Provided Templates: .Provided Templates:
@ -100,8 +98,5 @@ For example multiple `--no-deps --no-build` definitions.
| - | -
|=== |===
.Docker Templates :template: IaC/docker-compose.gitlab-ci.yml
[source,yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}/IaC/docker-compose.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
= ssh-transfer-data-template = ssh-transfer-data-template
This template provides a service to transfer data from a pipeline to a remote server. This template provides a service to transfer data from a pipeline to a remote server.
@ -13,8 +11,5 @@ For more details: https://gitlab.exxcellent.de/gilden/ci/exxcellent-ssh-tool#use
|SSH_HOST | the name of the remote host |- |SSH_HOST | the name of the remote host |-
|=== |===
.ssh-transfer-data-template :template: IaC/ssh-transfer-data.gitlab-ci.yml
[source, yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}IaC/ssh-transfer-data.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates
:gitlab-ci-file: /common/common-ci-variablen.gitlab-ci.yml :gitlab-ci-file: /common/common-ci-variablen.gitlab-ci.yml
[[Generel-Variablen]] [[Generel-Variablen]]
@ -22,6 +20,5 @@ Some of our Templates and Pipelines rely on the following variables.
|BACKEND_DIR| Directory where the backend code can be found. This is useful when the repository contains frontend and backend Code. |BACKEND_DIR| Directory where the backend code can be found. This is useful when the repository contains frontend and backend Code.
|=== |===
---- :template: {gitlab-ci-file}
include::{sourcedir}{gitlab-ci-file}[] include::../../../template-printer.adoc[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates
= Build = Build
.Provided Templates: .Provided Templates:
@ -40,8 +38,5 @@ The template <<_container_publish>> allows you to publish the build image to a r
| exxcellent Nexus | exxcellent Nexus
|=== |===
.Container Build Templates :template: container/container-build.gitlab-ci.yml
[source,yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}/container/container-build.gitlab-ci.yml[]
----

View File

@ -1,4 +1,3 @@
:sourcedir: ../../../../templates
[#_container_publish] [#_container_publish]
= Container Publish = Container Publish
@ -15,8 +14,5 @@ Needs a build container on the path `image.tar`. Use one of the Container build
| IMAGE_TAG | the Tag the image should be found on | Depends on the current path. Look at the rules of the Job. | IMAGE_TAG | the Tag the image should be found on | Depends on the current path. Look at the rules of the Job.
|=== |===
.container-publish :template: container/container-publish.gitlab-ci.yml
[source,yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}/container/container-publish.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
= Container CVE Scanner = Container CVE Scanner
Uses Trivy to scan for CVE Problems within your Image. Uses Trivy to scan for CVE Problems within your Image.
@ -28,8 +26,5 @@ Please consider using `allow_failure: true` instead of 0. The CI will show you a
|=== |===
.container scan template :template: container/container-scan.gitlab-ci.yml
[source,yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}container/container-scan.gitlab-ci.yml[]
----

View File

@ -1,12 +1,7 @@
:sourcedir: ../../../../templates/
= Docker in Docker = Docker in Docker
This template helps to start jobs, that need a docker environment to run. This template helps to start jobs, that need a docker environment to run.
Simply expand from this Template. Simply expand from this Template.
.container scan template :template: container/docker-in-docker.gitlab-ci.yml
[source,yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}container/docker-in-docker.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
= Dokumentation-Tool-template = Dokumentation-Tool-template
The Dokumentation tool template. The Dokumentation tool template.
@ -33,8 +31,5 @@ The following variables have to be set and are not optional.
| - | -
|=== |===
.dokumentation-tool :template: documentations/documentation.gitlab-ci.yml
[source,yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}documentations/documentation.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../../templates/
= Gradle-build-template = Gradle-build-template
This template resolves the gradle dependencies of your project and builds the project. This template resolves the gradle dependencies of your project and builds the project.
@ -13,8 +11,5 @@ The resulting build files will be published as artefacts.
|GRADLE_CLI_BUILD_OPTS | Additional Options that will be passed to Gradle while Building | "" |GRADLE_CLI_BUILD_OPTS | Additional Options that will be passed to Gradle while Building | ""
|=== |===
.gradle-build-template :template: java/gradle/gradle-build.gitlab-ci.yml
[source,yaml] include::../../../../template-printer.adoc[]
----
include::{sourcedir}java/gradle/gradle-build.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../../templates/
= Gradle Database Diff = Gradle Database Diff
This template generates a diff between the Liquibase schema and the Hibernate model of a database. This template generates a diff between the Liquibase schema and the Hibernate model of a database.
@ -19,8 +17,5 @@ Please look at the resulting changelog since it can have errors.
| PATH_TO_DIFF | Path to the resulting diff is defined in gradle config, this will also be exposed as the artefact of the Job. | "build/db-diff.xml" | PATH_TO_DIFF | Path to the resulting diff is defined in gradle config, this will also be exposed as the artefact of the Job. | "build/db-diff.xml"
|=== |===
.Gradle Liquibase Diff :template: java/gradle/gradle-database-diff.gitlab-ci.yml
[source,yaml] include::../../../../template-printer.adoc[]
----
include::{sourcedir}java/gradle/gradle-database-diff.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../../templates/
ifndef::imagesdir[] ifndef::imagesdir[]
:imagesdir: ../../../../images/ :imagesdir: ../../../../images/
endif::[] endif::[]
@ -20,8 +18,5 @@ image::GitlabCiTest.png[]
|GRADLE_CLI_OPTS | Zusätzliche CLI Opts für Gradle | "" |GRADLE_CLI_OPTS | Zusätzliche CLI Opts für Gradle | ""
|=== |===
.gradle-test-template :template: java/gradle/gradle-verify.gitlab-ci.yml
[source,yaml] include::../../../../template-printer.adoc[]
----
include::{sourcedir}java/gradle/gradle-verify.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../../templates/
= maven-build-template = maven-build-template
These Templates will build a .jar file with Maven and provides it as an Artifact These Templates will build a .jar file with Maven and provides it as an Artifact
@ -10,8 +8,5 @@ These Templates will build a .jar file with Maven and provides it as an Artifact
|MAVEN_CLI_BUILD_OPTS | Additional Options that will be passed to Maven while Building | "" |MAVEN_CLI_BUILD_OPTS | Additional Options that will be passed to Maven while Building | ""
|=== |===
.mvn-build-template :template: java/maven/maven-build.gitlab-ci.yml
[source, yaml] include::../../../../template-printer.adoc[]
----
include::{sourcedir}java/maven/maven-build.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../../templates/
= Maven Database Diff = Maven Database Diff
This template generates a diff between the Liquibase schema and the Hibernate model of a database. This template generates a diff between the Liquibase schema and the Hibernate model of a database.
@ -13,8 +11,5 @@ Please look at the resulting changelog since it can have errors.
| PATH_TO_DIFF | Path to the resulting diff is defined in gradle config, this will also be exposed as the artefact of the Job. | "target/db-diff.xml" | PATH_TO_DIFF | Path to the resulting diff is defined in gradle config, this will also be exposed as the artefact of the Job. | "target/db-diff.xml"
|=== |===
.gradle-build-template :template: java/maven/maven-database-diff.gitlab-ci.yml
[source,yaml] include::../../../../template-printer.adoc[]
----
include::{sourcedir}java/maven/maven-database-diff.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../../templates/
= Gradle Dependencies Template = Gradle Dependencies Template
This Template resolves the Maven Dependencies of your Projekt. This Template resolves the Maven Dependencies of your Projekt.
@ -10,8 +8,5 @@ The result will be cached when you include the common CI variables.
|Name |Description | Default Value |Name |Description | Default Value
|=== |===
.mvn-dependencies-template :template: java/maven/maven-dependencies.gitlab-ci.yml
[source, yaml] include::../../../../template-printer.adoc[]
----
include::{sourcedir}java/maven/maven-dependencies.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../../templates/
ifndef::imagesdir[] ifndef::imagesdir[]
:imagesdir: ../../../../images/ :imagesdir: ../../../../images/
endif::[] endif::[]
@ -20,8 +18,5 @@ image::GitlabCiTest.png[]
|Name |Description | Default Value |Name |Description | Default Value
|=== |===
.mvn-verify-template :template: /java/maven/maven-verify.gitlab-ci.yml
[source, yaml] include::../../../../template-printer.adoc[]
----
include::{sourcedir}/java/maven/maven-verify.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
= NPM Build Template = NPM Build Template
This template will build a NPM project and saved the artifacts for the next build step. This template will build a NPM project and saved the artifacts for the next build step.
@ -12,8 +10,5 @@ This template will build a NPM project and saved the artifacts for the next buil
| "" | ""
|=== |===
.npm-build-template :template: npm/npm-build.gitlab-ci.yml
[source, yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}npm/npm-build.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
= NPM Dependencies template = NPM Dependencies template
This template loads the NPM dependencies of the project. This template loads the NPM dependencies of the project.
@ -13,8 +11,5 @@ Please add the NPM cache. Look xref:Generel-Variablen[generell Variables]
| "" | ""
|=== |===
.npm-dependencies-template :template: npm/npm-dependencies.gitlab-ci.yml
[source, yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}npm/npm-dependencies.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
= NPM Lint template = NPM Lint template
This template starts the linter of your NPM project. This template starts the linter of your NPM project.
@ -12,8 +10,5 @@ This template starts the linter of your NPM project.
| "" | ""
|=== |===
.npm-lint-template :template: npm/npm-lint.gitlab-ci.yml
[source, yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}npm/npm-lint.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
= NPM Test Template = NPM Test Template
This template will run your NPM unit tests This template will run your NPM unit tests
@ -12,8 +10,5 @@ This template will run your NPM unit tests
| "" | ""
|=== |===
.npm-test-template :template: npm/npm-verify.gitlab-ci.yml
[source, yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}npm/npm-verify.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
= mail-template = mail-template
This template provides a service to send mails from a pipeline with the help of a smtp server. This template provides a service to send mails from a pipeline with the help of a smtp server.
@ -15,8 +13,5 @@ For more details: https://gitlab.exxcellent.de/gilden/ci/exxcellent-mail-tool[Gi
NOTE: The template uses the port 25 config as a default which doesn't need a smtp auth and a smtp user with the restriction that it only works from within the exxcellent gitlab-ci runners. For other configs visit the https://gitlab.exxcellent.de/gilden/ci/exxcellent-mail-tool[mail-tool docs] NOTE: The template uses the port 25 config as a default which doesn't need a smtp auth and a smtp user with the restriction that it only works from within the exxcellent gitlab-ci runners. For other configs visit the https://gitlab.exxcellent.de/gilden/ci/exxcellent-mail-tool[mail-tool docs]
.mail-template :template: releasing/mail.gitlab-ci.yml
[source, yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}releasing/mail.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
= Push Tag and Version Template = Push Tag and Version Template
This template creates a new tag und updates the version of your project in the repository. Additionally, the template builds a new artifact with the `mvn package` command after setting the version which then can be exported with the gitlab-ci _artifacts_ keyword and used in subsequent stages. This template creates a new tag und updates the version of your project in the repository. Additionally, the template builds a new artifact with the `mvn package` command after setting the version which then can be exported with the gitlab-ci _artifacts_ keyword and used in subsequent stages.
@ -13,8 +11,5 @@ For more details: https://gitlab.exxcellent.de/gilden/ci/exxcellent-ssh-tool[Gil
|MVN_EXTRA_ARGS | sets extra args which will be added behind the `mvn` command | "" |MVN_EXTRA_ARGS | sets extra args which will be added behind the `mvn` command | ""
|=== |===
.push-tag-and-version-template :template: releasing/push-tag-and-version.gitlab-ci.yml
[source, yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}releasing/push-tag-and-version.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
[#_release_gitlab_template] [#_release_gitlab_template]
= Gitlab Release Template = Gitlab Release Template
@ -11,8 +9,5 @@ This Template makes it easier to create Gitlab Release from the CI
|DESCRIPTION | The Content that has changed in the last release. Can be changed manual afterwards | "" |DESCRIPTION | The Content that has changed in the last release. Can be changed manual afterwards | ""
|=== |===
.Template :template: releasing/release-gitlab.gitlab-ci.yml
[source, yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}releasing/release-gitlab.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
[#_release_template] [#_release_template]
= Release Template = Release Template
@ -24,8 +22,5 @@ For more information see the <<_pipeline_release>> documentation.
|PARENT_PIPELINE_ID | The if of the parent pipeline. Needed to be able to use artifacts in the child pipeline | $CI_PIPELINE_ID |PARENT_PIPELINE_ID | The if of the parent pipeline. Needed to be able to use artifacts in the child pipeline | $CI_PIPELINE_ID
|=== |===
.release-template :template: releasing/release.gitlab-ci.yml
[source, yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}releasing/release.gitlab-ci.yml[]
----

View File

@ -1,6 +1,3 @@
:sourcedir: ../../../../templates/
= Set Version = Set Version
This template provides the job for increasing the tag version. This template provides the job for increasing the tag version.
@ -22,8 +19,5 @@ a|
** use more traditional version number. e.g: 1.2.3.6 | "false" ** use more traditional version number. e.g: 1.2.3.6 | "false"
|=== |===
.set-version-template :template: /releasing/set-version.gitlab-ci.yml
[source, yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}/releasing/set-version.gitlab-ci.yml[]
----

View File

@ -1,5 +1,3 @@
:sourcedir: ../../../../templates/
= Repo CVE Scan = Repo CVE Scan
This template uses Trivy to scan for CVEs, Configuration Problems and Secrets within your Repository. This template uses Trivy to scan for CVEs, Configuration Problems and Secrets within your Repository.
@ -27,8 +25,5 @@ Please consider using `allow_failure: true` instead of 0. The CI will show you a
|=== |===
.Repo CVE scan template :template: static-analysis/repo-cve-scan-trivy.gitlab-ci.yml
[source,yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}static-analysis/repo-cve-scan-trivy.gitlab-ci.yml[]
----

View File

@ -1,4 +1,3 @@
:sourcedir: ../../../../templates/
= Sonar 7 = Sonar 7
The following templates provide integrations for Sonar The following templates provide integrations for Sonar
@ -20,8 +19,5 @@ Ein technischer User ist aktuell nicht möglich.
Das Token wird ausschließlich dafür benötigt, wenn der Sonar Buildbreaker über die Pipeline aktiviert wird (_sonar.buildbreaker.skip=true_). Das Token wird ausschließlich dafür benötigt, wenn der Sonar Buildbreaker über die Pipeline aktiviert wird (_sonar.buildbreaker.skip=true_).
Wenn der Build nicht gebrochen werden soll, kann es weggelassen werden. Wenn der Build nicht gebrochen werden soll, kann es weggelassen werden.
.sonar-template :template: static-analysis/sonar-7.gitlab-ci.yml
[source,yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}static-analysis/sonar-7.gitlab-ci.yml[]
----

View File

@ -1,4 +1,3 @@
:sourcedir: ../../../../templates/
= Sonar 8 = Sonar 8
The following templates provide integrations for Sonar The following templates provide integrations for Sonar
@ -18,8 +17,5 @@ Has to be `true` if the quality-gate should fail your pipelines. Please consider
|=== |===
.sonar-template :template: static-analysis/sonar-8.gitlab-ci.yml
[source,yaml] include::../../../template-printer.adoc[]
----
include::{sourcedir}static-analysis/sonar-8.gitlab-ci.yml[]
----

View File

@ -0,0 +1,17 @@
.Include
[source,yaml,subs=attributes]
----
include:
- project: 'gilden/ci/gitlab-ci-templates'
ref: 'master'
file:
- '/templates/{template}'
----
.Original Template
[source,yaml]
----
include::../templates/{template}[]
----