Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
muk-postfach
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
muk-postfach
Commits
c9b0ec3e
Commit
c9b0ec3e
authored
4 months ago
by
Martin
Browse files
Options
Downloads
Patches
Plain Diff
OZG-7324 adjust JenkinsFile
parent
a40446ba
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
+11
-7
11 additions, 7 deletions
Jenkinsfile
with
11 additions
and
7 deletions
Jenkinsfile
+
11
−
7
View file @
c9b0ec3e
...
...
@@ -6,7 +6,7 @@ pipeline {
}
environment
{
BLUE_OCEAN
_URL
=
"https://jenkins.infra.ozg-cloud.systems/job/muk-postfach/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
JENKINS
_URL
=
"https://jenkins.infra.ozg-cloud.systems/job/
codeSH_
muk-postfach/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
RELEASE_REGEX
=
/\d+.\d+.\d+/
SNAPSHOT_REGEX
=
/\d+.\d+.\d+-SNAPSHOT/
FAILED_STAGE
=
""
...
...
@@ -42,7 +42,7 @@ pipeline {
when
{
not
{
anyOf
{
branch
'ma
ster
'
branch
'ma
in
'
branch
'release'
}
}
...
...
@@ -111,7 +111,7 @@ pipeline {
stage
(
'Sonar Checks'
)
{
when
{
branch
'ma
ster
'
branch
'ma
in
'
}
steps
{
script
{
...
...
@@ -137,7 +137,7 @@ pipeline {
}
failure
{
script
{
if
(
env
.
BRANCH_NAME
==
'master'
||
env
.
BRANCH_NAME
==
'release'
)
{
if
(
isMainBranch
()
||
env
.
BRANCH_NAME
==
'release'
)
{
sendFailureMessage
()
}
}
...
...
@@ -154,7 +154,7 @@ String getPomVersion(String pomFile){
String
generateImageTag
()
{
def
imageTag
=
"${env.BRANCH_NAME}-${getPomVersion('pom.xml')}"
if
(
env
.
BRANCH_NAME
==
'master'
)
{
if
(
isMainBranch
()
)
{
imageTag
+=
"-${env.GIT_COMMIT.take(7)}"
}
...
...
@@ -174,9 +174,9 @@ Void configureGit() {
Void
sendFailureMessage
()
{
def
room
=
''
def
data
=
"""{"msgtype":"m.text", \
"body":"MUK-Postfach: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${
BLUE_OCEAN
_URL}", \
"body":"MUK-Postfach: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${
JENKINS
_URL}", \
"format": "org.matrix.custom.html", \
"formatted_body":"MUK-Postfach: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${
BLUE_OCEAN
_URL}'>${env.BUILD_NUMBER}</a>"}"""
"formatted_body":"MUK-Postfach: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${
JENKINS
_URL}'>${env.BUILD_NUMBER}</a>"}"""
if
(
env
.
BRANCH_NAME
==
'main'
)
{
room
=
"!iQPAvQIiRwRpNOszjw:matrix.ozg-sh.de"
...
...
@@ -193,3 +193,7 @@ String getElementAccessToken() {
return
readJSON
(
text:
sh
(
script:
'''curl -XPOST -d \"$LOGIN_JSON\" https://matrix.ozg-sh.de/_matrix/client/v3/login'''
,
returnStdout:
true
)).
access_token
}
}
Boolean
isMainBranch
()
{
return
env
.
BRANCH_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