From: Frank Brehm Date: Tue, 12 Jul 2022 12:18:03 +0000 (+0200) Subject: Enabling notification jobs X-Git-Tag: 0.4.2^2~3^2 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=745ab17a5997aa8a1a1bc56cc43e33db1db781bb;p=pixelpark%2Fpp-admin-tools.git Enabling notification jobs --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 53f5e4f..52026a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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