Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
package_alerts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
linuxsupport
cronjobs
package_alerts
Commits
766758bb
Commit
766758bb
authored
2 years ago
by
Alex Iribarren
Browse files
Options
Downloads
Patches
Plain Diff
Make messages nicer, alert
@all
parent
7fb92613
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#4490234
passed
2 years ago
Stage: build
Stage: deploy_test
Stage: deploy
Stage: cleanup
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
centos_rss/centos_rss
+9
-3
9 additions, 3 deletions
centos_rss/centos_rss
with
9 additions
and
3 deletions
centos_rss/centos_rss
+
9
−
3
View file @
766758bb
...
...
@@ -117,7 +117,7 @@ def format_release(release, f):
values
=
{}
# Using Mattermost attachments for prettier messages
# https://developers.mattermost.com/integrate/admin-guide/admin-message-attachments/
values
[
'
pretext
'
]
=
f
"
{
f
}
: **
{
release
[
'
title
'
]
}
**
"
values
[
'
pretext
'
]
=
f
"
@all new package released in
{
f
}
: **
{
release
[
'
title
'
]
}
**
"
# Let's grab just the changelog from the summary
summary
=
release
[
'
summary
'
].
split
(
'
\n
'
)
...
...
@@ -129,8 +129,14 @@ def format_release(release, f):
if
notes
:
values
[
'
fields
'
]
=
[{
'
title
'
:
'
Notes
'
,
'
value
'
:
notes
,
'
short
'
:
False
}]
response
=
requests
.
post
(
mattermost_integration_url
,
json
=
{
'
attachments
'
:
[
values
]})
payload
=
{
'
username
'
:
'
Newsguin, Reader of Feeds
'
,
'
icon_url
'
:
'
https://airibarr.web.cern.ch/airibarr/robotpenguin.png
'
,
'
attachments
'
:
[
values
],
}
response
=
requests
.
post
(
mattermost_integration_url
,
json
=
payload
)
print
(
f
"
-- Sent notification to Mattermost, response code was
{
response
.
status_code
}
"
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment