]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Enabling notification jobs
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 12 Jul 2022 12:18:03 +0000 (14:18 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 12 Jul 2022 12:18:03 +0000 (14:18 +0200)
.gitlab-ci.yml

index 53f5e4fa6cbd58abc4369dac3b3b6952473c73ed..52026a21ae47791764f7a6fd78731d5b4dea71e8 100644 (file)
@@ -24,7 +24,7 @@ variables:
   VERSION_PREFIX: 'unknown'
   YUM_REPO_GPG_ID: 'C0E73F70'
   YUM_REPO_GPG_PASSWD: 'secret'
-  YUM_REPO_HOST: 'repo01.pixelpark.com'
+  YUM_REPO_HOST: 'repo02.pixelpark.com'
   YUM_REPO_USER: 'rpm-repo'
   YUM_REPO_DIR_HTTP: '/Linux/yum/pixelpark'
   YUM_REPO_DIR: "/srv/www/repo${YUM_REPO_DIR_HTTP}"
@@ -430,31 +430,44 @@ Deploy packages EL8:
     - 'Sign EL 8 packages'
 
 # ---------------------------
-.notify-rules:
-  rules:
-    - if: '$CI_COMMIT_TAG'
-    - if: $CI_COMMIT_BRANCH == "master"
-    - if: $CI_COMMIT_BRANCH == "main"
-    - if: $CI_COMMIT_BRANCH == "test"
-  tags:
-    - docker_v2
-  needs:
-    - 'Deploy packages EL7'
-    - 'Deploy packages EL8'
+.notify-rules:
+  rules:
+    - if: '$CI_COMMIT_TAG'
+    - if: $CI_COMMIT_BRANCH == "master"
+    - if: $CI_COMMIT_BRANCH == "main"
+    - if: $CI_COMMIT_BRANCH == "test"
+  tags:
+    - docker_v2
+  needs:
+    - 'Deploy packages EL7'
+    - 'Deploy packages EL8'
 
 # ---------------------------
-# Notify Success:
-#   extends:
-#     - '.notify-rules'
-#   allow_failure: true
-#   script: 'echo -e "Module ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME} (${CI_COMMIT_REF_NAME}): all checks successful\nCommiter: ${GITLAB_USER_NAME} <${GITLAB_USER_EMAIL}>" | mailx -s "Gitlab-CI: Python module fb_tools" -r "$SENDER_ADDRESS" $NOTIFY_ADDRESS'
+Notify Success:
+  stage: notify
+  extends:
+    - '.notify-rules'
+  allow_failure: true
+  script: |
+    mailbody="Module ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME} (${CI_COMMIT_REF_NAME}): "
+    mailbody+="all checks successful\nCommiter: ${GITLAB_USER_NAME} <${GITLAB_USER_EMAIL}>\n"
+    mailbody+="Commiter: ${GITLAB_USER_NAME} <${GITLAB_USER_EMAIL}>"
+    subject="Gitlab-CI: Python module pp-admintools"
+    echo -e "${mailbody}" | mailx -s "${subject}" -r "${SENDER_ADDRESS}" "${NOTIFY_ADDRESS}"
 
 # ---------------------------
-# Notify Error:
-#   extends:
-#     - '.notify-rules'
-#   allow_failure: true
-#   when: on_failure
-#   script: 'echo -e "Error in module ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME} (${CI_COMMIT_REF_NAME})\nPlease check ${CI_PROJECT_URL}/pipelines/${CI_PIPELINE_ID}\n\nCommiter: ${GITLAB_USER_NAME} <${GITLAB_USER_EMAIL}>" | mailx -s "Gitlab-CI error for Python module fb_tools" -r "$SENDER_ADDRESS" "$NOTIFY_ADDRESS"'
+Notify Error:
+  stage: notify
+  extends:
+    - '.notify-rules'
+  allow_failure: true
+  when: on_failure
+  script: |
+    mailbody="Error in module ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME} (${CI_COMMIT_REF_NAME})\n"
+    mailbody+="Please check ${CI_PROJECT_URL}/pipelines/${CI_PIPELINE_ID}\n\n"
+    mailbody+="Commiter: ${GITLAB_USER_NAME} <${GITLAB_USER_EMAIL}>"
+    subject="Gitlab-CI error for Python module pp-admintools"
+    echo -e "${mailbody}" | mailx -s "${subject}" -r "${SENDER_ADDRESS}" "${NOTIFY_ADDRESS}"
+
 
 # vim: et tabstop=2 expandtab shiftwidth=2 softtabstop=2 list