Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eingang-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
eingang-manager
Commits
11e0d836
Commit
11e0d836
authored
3 years ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
add version check to jenkins pipeline
parent
f1ce80c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jenkinsfile
+38
-0
38 additions, 0 deletions
Jenkinsfile
with
38 additions
and
0 deletions
Jenkinsfile
+
38
−
0
View file @
11e0d836
...
@@ -9,6 +9,8 @@ pipeline {
...
@@ -9,6 +9,8 @@ pipeline {
environment
{
environment
{
BLUE_OCEAN_URL
=
"https://jenkins.ozg-sh.de/blue/organizations/jenkins/intelliform-adapter/detail/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/pipeline"
BLUE_OCEAN_URL
=
"https://jenkins.ozg-sh.de/blue/organizations/jenkins/intelliform-adapter/detail/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/pipeline"
RELEASE_REGEX
=
/\d+.\d+.\d+/
SNAPSHOT_REGEX
=
/\d+.\d+.\d+-SNAPSHOT/
}
}
options
{
options
{
...
@@ -18,6 +20,42 @@ pipeline {
...
@@ -18,6 +20,42 @@ pipeline {
}
}
stages
{
stages
{
stage
(
'Check Version'
)
{
steps
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
def
rootPom
=
readMavenPom
file:
'pom.xml'
def
rootVersion
=
rootPom
.
version
def
plutoVersion
=
rootPom
.
properties
.
pluto
.
version
def
commonPom
=
readMavenPom
file:
'common/pom.xml'
def
commonVersion
=
commonPom
.
parent
.
version
def
routerPom
=
readMavenPom
file:
'router/pom.xml'
def
routerVersion
=
routerPom
.
parent
.
version
def
ifAdapterPom
=
readMavenPom
file:
'intelliform-adapter/pom.xml'
def
ifAdapterVersion
=
ifAdapterPom
.
parent
.
version
def
fsAdapterPom
=
readMavenPom
file:
'formsolutions-adapter/pom.xml'
def
fsAdapterVersion
=
fsAdapterPom
.
parent
.
version
if
(
env
.
BRANCH_NAME
==
'release'
){
if
(
!(
rootVersion
==~
RELEASE_REGEX
)
||
!(
plutoVersion
==~
RELEASE_REGEX
)
||
!(
commonVersion
==~
RELEASE_REGEX
)
||
!(
routerVersion
==~
RELEASE_REGEX
)
||
!(
ifAdapterVersion
==~
RELEASE_REGEX
)
||
!(
fsAdapterVersion
==~
RELEASE_REGEX
))
{
error
(
"Keine Release Version für Branch ${env.BRANCH_NAME}."
)
}
}
else
{
if
(
!(
rootVersion
==~
SNAPSHOT_REGEX
)
||
!(
plutoVersion
==~
SNAPSHOT_REGEX
)
||
!(
commonVersion
==~
SNAPSHOT_REGEX
)
||
!(
routerVersion
==~
SNAPSHOT_REGEX
)
||
!(
ifAdapterVersion
==~
SNAPSHOT_REGEX
)
||
!(
fsAdapterVersion
==~
SNAPSHOT_REGEX
))
{
error
(
"Keine Snapshot Version für Branch ${env.BRANCH_NAME}."
)
}
}
if
(
!(
rootVersion
==
commonVersion
&&
rootVersion
==
routerVersion
&&
rootVersion
==
ifAdapterVersion
&&
rootVersion
==
fsAdapterVersion
)){
error
(
"Versionen sind nicht identisch"
)
}
}
}
}
stage
(
'Build Eingang-Adapter'
)
{
stage
(
'Build Eingang-Adapter'
)
{
steps
{
steps
{
script
{
script
{
...
...
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