Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
antragraum-proxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
antragraum-proxy
Compare revisions
1169d7f2ff3ee79ba4b18d02edbbeed8e12cc926 to 5b10098f2f3528826a6c40e8015bc28ca2a43773
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
ozg-cloud/app/antragraum-proxy
Select target project
No results found
5b10098f2f3528826a6c40e8015bc28ca2a43773
Select Git revision
Swap
Target
ozg-cloud/app/antragraum-proxy
Select target project
ozg-cloud/app/antragraum-proxy
1 result
1169d7f2ff3ee79ba4b18d02edbbeed8e12cc926
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
ozg-7493 add send failure message
· c15cdd16
Bastian
authored
2 months ago
c15cdd16
Merge branch 'ozg-7493-add-matrix-notification' into 'main'
· 5b10098f
Bastian Heppener
authored
2 months ago
ozg-7493 add send failure message See merge request
!2
5b10098f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jenkinsfile
+12
-30
12 additions, 30 deletions
Jenkinsfile
with
12 additions
and
30 deletions
Jenkinsfile
View file @
5b10098f
...
...
@@ -21,6 +21,8 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
@Library
(
'ozgcloud-libs'
)
_
pipeline
{
agent
{
node
{
...
...
@@ -29,6 +31,7 @@ pipeline {
}
environment
{
PIPELINE_NAME
=
"Code-SH: antragraum-proxy"
RELEASE_REGEX
=
/v\d+.\d+.\d+/
BETA_REGEX
=
/v\d+.\d+.\d+-beta.\d/
FAILED_STAGE
=
""
...
...
@@ -190,6 +193,7 @@ pipeline {
}
steps
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
catchError
(
buildResult:
'UNSTABLE'
,
stageResult:
'FAILURE'
)
{
sh
'''
go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest
...
...
@@ -204,7 +208,14 @@ pipeline {
}
}
}
}
}
post
{
failure
{
script
{
sendMatrixMessage
.
sendFailureMessage
(
FAILED_STAGE
)
}
}
}
}
...
...
@@ -256,35 +267,6 @@ String getBuildProfile() {
}
}
Void
sendFailureMessage
()
{
def
room
=
getRoom
()
def
data
=
getFailureData
()
sh
"curl -XPOST -H 'authorization: Bearer ${getElementAccessToken()}' -d '${data}' https://matrix.ozg-sh.de/_matrix/client/v3/rooms/$room/send/m.room.message"
}
String
getElementAccessToken
()
{
withCredentials
([
string
(
credentialsId:
'element-login-json'
,
variable:
'LOGIN_JSON'
)])
{
return
readJSON
(
text:
sh
(
script:
'''curl -XPOST -d \"$LOGIN_JSON\" https://matrix.ozg-sh.de/_matrix/client/v3/login'''
,
returnStdout:
true
)).
access_token
}
}
String
getFailureData
()
{
return
"""{"msgtype":"m.text", \
"body":"antragraum-proxy: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER}", \
"format": "org.matrix.custom.html", \
"formatted_body":"antragraum-proxy: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER}"}"""
}
String
getRoom
()
{
if
(
isReleaseBranch
())
{
return
"!oWZpUGTFsxkJIYNfYg:matrix.ozg-sh.de"
}
else
{
return
"!iQPAvQIiRwRpNOszjw:matrix.ozg-sh.de"
}
}
Void
configureGit
()
{
def
email
=
"jenkins@ozg-sh.de"
def
name
=
"jenkins"
...
...
This diff is collapsed.
Click to expand it.