Last active
April 19, 2022 14:53
-
-
Save aleksandr-kotlyar/c21d0bc92266c5edcbd9255b04b6a90d to your computer and use it in GitHub Desktop.
slack text notifications
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SLACK_TEXT_START: 'Pipeline <$CI_PIPELINE_URL|$CI_PIPELINE_ID> _has started_ *$CI_PIPELINE_SOURCE* job <$CI_JOB_URL|$CI_JOB_ID> on *$ENVIRONMENT* _at branch_ *<$CI_PROJECT_URL/commit/$CI_COMMIT_SHA|$CI_COMMIT_REF_NAME>*' | |
SLACK_TEXT_FINISH: 'Pipeline <$CI_PIPELINE_URL|$CI_PIPELINE_ID> _has finished_ *$CI_PIPELINE_SOURCE* job <$CI_JOB_URL|$CI_JOB_ID> on *$ENVIRONMENT* _at branch_ *<$CI_PROJECT_URL/commit/$CI_COMMIT_SHA|$CI_COMMIT_REF_NAME>* _and generated_ *<$ALLURE_DIR|Allure Reports>*' | |
##################################### | |
# Custom Slack POST-message report # | |
##################################### | |
slack_notification: | |
script: | |
- > | |
curl | |
--request POST | |
--data-urlencode | |
"payload={ | |
\"channel\":\"$SLACK_CHANNEL\", | |
\"username\":\"$SLACK_USER\", | |
\"text\":\"$SLACK_TEXT_FINISH\", | |
\"icon_emoji\":\":gitlab:\" | |
}" | |
https://hooks.slack.com/services/$SLACK_TOKEN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment