Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c4c1e707
Commit
c4c1e707
authored
Aug 07, 2020
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notify Slack #g_create_gitaly when updating Gitaly failed
parent
489520a9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
.gitlab-ci.yml
.gitlab-ci.yml
+2
-0
.gitlab/ci/notify.gitlab-ci.yml
.gitlab/ci/notify.gitlab-ci.yml
+23
-0
scripts/slack
scripts/slack
+17
-0
No files found.
.gitlab-ci.yml
View file @
c4c1e707
...
...
@@ -10,6 +10,7 @@ stages:
-
qa
-
post-qa
-
pages
-
notify
# always use `gitlab-org` runners, however
# in cases where jobs require Docker-in-Docker, the job
...
...
@@ -81,3 +82,4 @@ include:
-
local
:
.gitlab/ci/test-metadata.gitlab-ci.yml
-
local
:
.gitlab/ci/yaml.gitlab-ci.yml
-
local
:
.gitlab/ci/releases.gitlab-ci.yml
-
local
:
.gitlab/ci/notify.gitlab-ci.yml
.gitlab/ci/notify.gitlab-ci.yml
0 → 100644
View file @
c4c1e707
.notify-slack
:
image
:
alpine
stage
:
notify
dependencies
:
[]
cache
:
{}
before_script
:
-
apk update && apk add git curl bash
notify-update-gitaly
:
extends
:
-
.notify-slack
rules
:
-
if
:
'
$CI_MERGE_REQUEST_IID
&&
$CI_COMMIT_BRANCH
==
$GITALY_UPDATE_BRANCH'
when
:
on_failure
allow_failure
:
true
variables
:
NOTIFY_CHANNEL
:
g_create_gitaly
GITALY_UPDATE_BRANCH
:
release-tools/update-gitaly
MERGE_REQUEST_URL
:
${CI_MERGE_REQUEST_PROJECT_URL}/-/merge_requests/${CI_MERGE_REQUEST_IID}
script
:
-
echo "NOTIFY_CHANNEL is ${NOTIFY_CHANNEL}"
-
echo "CI_PIPELINE_URL is ${CI_PIPELINE_URL}"
-
scripts/slack ${NOTIFY_CHANNEL} "☠️ \`${GITALY_UPDATE_BRANCH}\` failed! ☠️ See ${CI_PIPELINE_URL} (triggered from ${MERGE_REQUEST_URL})" ci_failing
scripts/slack
0 → 100755
View file @
c4c1e707
#!/bin/bash
# This is copied from:
# https://gitlab.com/gitlab-org/gitlab-qa/-/blob/master/bin/slack
#
# Sends Slack notification MSG to CI_SLACK_WEBHOOK_URL (which needs to be set).
# ICON_EMOJI needs to be set to an icon emoji name (without the `:` around it).
CHANNEL
=
$1
MSG
=
$2
ICON_EMOJI
=
$3
if
[
-z
"
$CHANNEL
"
]
||
[
-z
"
$CI_SLACK_WEBHOOK_URL
"
]
||
[
-z
"
$MSG
"
]
||
[
-z
"
$ICON_EMOJI
"
]
;
then
echo
"Missing argument(s) - Use:
$0
channel message icon_emoji"
echo
"and set CI_SLACK_WEBHOOK_URL environment variable."
else
curl
-X
POST
--data-urlencode
'payload={"channel": "#'
"
$CHANNEL
"
'", "username": "GitLab QA Bot", "text": "'
"
$MSG
"
'", "icon_emoji": "'
":
$ICON_EMOJI
:"
'"}'
"
$CI_SLACK_WEBHOOK_URL
"
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment