From 78db737489be51f327ec012eb16f619c7dd97905 Mon Sep 17 00:00:00 2001 From: Wolfram Gulde Date: Tue, 14 Sep 2021 16:00:35 +0200 Subject: [PATCH 1/3] feat(ssh): templates for mail and ssh transfer data tools --- .../chapters/templates/mail-template.adoc | 22 +++++++++++++++++++ .../templates/ssh-transfer-data-template.adoc | 20 +++++++++++++++++ documentation/document.adoc | 4 +++- mail-template.gitlab-ci.yml | 8 +++++++ ssh-transfer-data-template.gitlab-ci.yml | 5 +++++ 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 documentation/chapters/templates/mail-template.adoc create mode 100644 documentation/chapters/templates/ssh-transfer-data-template.adoc create mode 100644 mail-template.gitlab-ci.yml create mode 100644 ssh-transfer-data-template.gitlab-ci.yml diff --git a/documentation/chapters/templates/mail-template.adoc b/documentation/chapters/templates/mail-template.adoc new file mode 100644 index 0000000..8803db8 --- /dev/null +++ b/documentation/chapters/templates/mail-template.adoc @@ -0,0 +1,22 @@ +:sourcedir: ../../../ + += mail-template + +This template provides a service to send mails from a pipeline with the help of a smtp server. +For more details: https://gitlab.exxcellent.de/gilden/ci/exxcellent-mail-tool[Gilde CI/CD: exxcellent-mail-tool]. + + +.Variables +|=== +|Name |Description | Default Value +|SMTP_PORT | the smtp port |25 +|SMTP_AUTH | flag if smtp auth should be used |off +|=== + +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 +[source, yaml] +---- +include::{sourcedir}/mail-template.gitlab-ci.yml[] +---- \ No newline at end of file diff --git a/documentation/chapters/templates/ssh-transfer-data-template.adoc b/documentation/chapters/templates/ssh-transfer-data-template.adoc new file mode 100644 index 0000000..3d10277 --- /dev/null +++ b/documentation/chapters/templates/ssh-transfer-data-template.adoc @@ -0,0 +1,20 @@ +:sourcedir: ../../../ + += ssh-transfer-data-template + +This template provides a service to transfer data from a pipeline to a remote server. +For more details: https://gitlab.exxcellent.de/gilden/ci/exxcellent-ssh-tool[Gilde CI/CD: exxcellent-ssh-tool]. + + +.Variables +|=== +|Name |Description | Default Value +|SSH_USER | the name of the remote user |- +|SSH_HOST | the name of the remote host |- +|=== + +.ssh-transfer-data-template +[source, yaml] +---- +include::{sourcedir}/ssh-transfer-data-template.gitlab-ci.yml[] +---- \ No newline at end of file diff --git a/documentation/document.adoc b/documentation/document.adoc index 07d96a5..4c334fe 100644 --- a/documentation/document.adoc +++ b/documentation/document.adoc @@ -78,7 +78,9 @@ Sollte dieser noch nicht vorhanden sein kann er mit dem Befehl `gradle wrapper` include::chapters/templates/gradle-build-template.adoc[leveloffset=2] include::chapters/templates/gradle-test-template.adoc[leveloffset=2] -== weitere Gilden-Tools +== Weitere Gilden-Tools include::chapters/templates/tool-sonar7.adoc[leveloffset=2] include::chapters/templates/tool-documentation-tool.adoc[leveloffset=2] +include::chapters/templates/mail-template.adoc[leveloffset=2] +include::chapters/templates/ssh-transfer-data-template.adoc[leveloffset=2] diff --git a/mail-template.gitlab-ci.yml b/mail-template.gitlab-ci.yml new file mode 100644 index 0000000..318e944 --- /dev/null +++ b/mail-template.gitlab-ci.yml @@ -0,0 +1,8 @@ +.send-mail: + image: gitlab.exxcellent.de:4567/gilden/ci/exxcellent-mail-tool:1.1.0 + stage: send-mail + variables: + SMTP_PORT: "25" + SMTP_AUTH: "off" + rules: + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH diff --git a/ssh-transfer-data-template.gitlab-ci.yml b/ssh-transfer-data-template.gitlab-ci.yml new file mode 100644 index 0000000..9c96fe4 --- /dev/null +++ b/ssh-transfer-data-template.gitlab-ci.yml @@ -0,0 +1,5 @@ +.ssh-transfer-data: + image: gitlab.exxcellent.de:4567/gilden/ci/exxcellent-ssh-tool:1.3.0 + stage: ssh-transfer-data + before_script: + - setup-ssh From 27a0f95f6f44de2aa2c08401b4400dcc8d52f043 Mon Sep 17 00:00:00 2001 From: Wolfram Gulde Date: Tue, 21 Sep 2021 13:03:02 +0200 Subject: [PATCH 2/3] feat(ssh): directly link to transfer data chapter in ssh docs --- .../chapters/templates/ssh-transfer-data-template.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/chapters/templates/ssh-transfer-data-template.adoc b/documentation/chapters/templates/ssh-transfer-data-template.adoc index 3d10277..7134238 100644 --- a/documentation/chapters/templates/ssh-transfer-data-template.adoc +++ b/documentation/chapters/templates/ssh-transfer-data-template.adoc @@ -3,7 +3,7 @@ = ssh-transfer-data-template This template provides a service to transfer data from a pipeline to a remote server. -For more details: https://gitlab.exxcellent.de/gilden/ci/exxcellent-ssh-tool[Gilde CI/CD: exxcellent-ssh-tool]. +For more details: https://gitlab.exxcellent.de/gilden/ci/exxcellent-ssh-tool#user-content-use-case-copy-data-with-scp[Gilde CI/CD: exxcellent-ssh-tool]. .Variables From f260faf87fe4b7060e614149b63062214adcd1d6 Mon Sep 17 00:00:00 2001 From: Wolfram Gulde Date: Tue, 21 Sep 2021 15:33:07 +0200 Subject: [PATCH 3/3] feat(Templates): cleanup --- documentation/chapters/templates/docker-compose-deploy.adoc | 2 +- documentation/chapters/templates/docker-compose-validate.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/chapters/templates/docker-compose-deploy.adoc b/documentation/chapters/templates/docker-compose-deploy.adoc index 18e3692..3010977 100644 --- a/documentation/chapters/templates/docker-compose-deploy.adoc +++ b/documentation/chapters/templates/docker-compose-deploy.adoc @@ -60,6 +60,6 @@ Secrets sollten nicht in der Repository liegen sondern in den CI-CD variablen de .Docker compose deploy ---- -include::{sourcedir}/docker-compose-deploy.yml[] +include::{sourcedir}/docker-compose-deploy.gitlab-ci.yml[] ---- diff --git a/documentation/chapters/templates/docker-compose-validate.adoc b/documentation/chapters/templates/docker-compose-validate.adoc index 09afefa..2e1d505 100644 --- a/documentation/chapters/templates/docker-compose-validate.adoc +++ b/documentation/chapters/templates/docker-compose-validate.adoc @@ -15,5 +15,5 @@ Validiert die semantische Korrektheit eines Docker-Compose files. .Docker compose validate ---- -include::{sourcedir}/docker-compose-validate.yml[] +include::{sourcedir}/docker-compose-validate.gitlab-ci.yml[] ---- \ No newline at end of file