Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
api-lib
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
lib
api-lib
Commits
612b2d18
Commit
612b2d18
authored
4 months ago
by
Martin
Browse files
Options
Downloads
Patches
Plain Diff
OZG-7324 adjust JenkinsFile
parent
6d21272f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jenkinsfile
+10
-6
10 additions, 6 deletions
Jenkinsfile
with
10 additions
and
6 deletions
Jenkinsfile
+
10
−
6
View file @
612b2d18
...
...
@@ -8,7 +8,7 @@ pipeline {
}
environment
{
BLUE_OCEAN
_URL
=
"https://jenkins.ozg-sh.de/job/api-lib/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
JENKINS
_URL
=
"https://jenkins.ozg-sh.de/job/
codeSH_
api-lib/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
RELEASE_REGEX
=
/\d+.\d+.\d+/
SNAPSHOT_REGEX
=
/\d+.\d+.\d+-SNAPSHOT/
}
...
...
@@ -43,7 +43,7 @@ pipeline {
when
{
not
{
anyOf
{
branch
'ma
ster
'
branch
'ma
in
'
branch
'release'
}
}
...
...
@@ -85,7 +85,7 @@ pipeline {
post
{
failure
{
script
{
if
(
env
.
BRANCH_NAME
==
'master'
||
env
.
BRANCH_NAME
==
'release'
)
{
if
(
isMainBranch
()
||
env
.
BRANCH_NAME
==
'release'
)
{
sendFailureMessage
()
}
}
...
...
@@ -96,11 +96,11 @@ pipeline {
Void
sendFailureMessage
()
{
def
room
=
''
def
data
=
"""{"msgtype":"m.text", \
"body":"api-lib: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${
BLUE_OCEAN
_URL}", \
"body":"api-lib: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${
JENKINS
_URL}", \
"format": "org.matrix.custom.html", \
"formatted_body":"api-lib: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${
BLUE_OCEAN
_URL}'>${env.BUILD_NUMBER}</a>"}"""
"formatted_body":"api-lib: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${
JENKINS
_URL}'>${env.BUILD_NUMBER}</a>"}"""
if
(
env
.
BRANCH_NAME
==
'master'
)
{
if
(
isMainBranch
()
)
{
room
=
"!GjqhmouBtnDbwUkAjx:matrix.ozg-sh.de"
}
else
if
(
env
.
BRANCH_NAME
==
'release'
)
{
...
...
@@ -120,4 +120,8 @@ String getPomVersion(String pomFile){
def
pom
=
readMavenPom
file:
pomFile
return
pom
.
version
}
Boolean
isMainBranch
()
{
return
env
.
BRANCH_NAME
==
'main'
}
\ No newline at end of file
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