Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dockerized Testing Toolkit
Testrunner OpenJDK11 JUnit5-Jupiter
Commits
891d519a
Verified
Commit
891d519a
authored
Dec 14, 2020
by
Lukas Wiest
🚂
Browse files
ci: add jenkins script for multibranch pipeline
parent
87de694f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Jenkinsfile
0 → 100644
View file @
891d519a
def
version
=
""
pipeline
{
environment
{
registry
=
"hftstuttgart/modocot-openjdk11-juni5-testrunner"
registryCredential
=
'Dockerhub'
dockerImage
=
''
}
agent
any
tools
{
jdk
'Java11'
maven
'Maven_Home'
}
stages
{
stage
(
'prepare'
)
{
steps
{
checkout
([
$class
:
'GitSCM'
,
branches:
scm
.
branches
,
extensions:
scm
.
extensions
+
[[
$class
:
'CloneOption'
,
noTags:
false
,
reference:
''
,
shallow:
false
]],
userRemoteConfigs:
scm
.
userRemoteConfigs
])
script
{
version
=
sh
(
script:
'git describe --tags --always'
,
returnStdout:
true
).
trim
()
echo
sh
(
script:
'env|sort'
,
returnStdout:
true
)
}
}
}
stage
(
'compile'
)
{
steps
{
sh
'mvn clean package'
}
}
stage
(
'build Docker image'
)
{
steps
{
script
{
dockerImage
=
docker
.
build
registry
}
}
}
stage
(
'push development image'
)
{
steps
{
script
{
docker
.
withRegistry
(
''
,
registryCredential
)
{
dockerImage
.
push
(
"${env.GIT_BRANCH}"
)
}
}
}
}
stage
(
'release'
)
{
when
{
expression
{
version
==~
/[0-9]+.[0-9]+.[0-9]+/
}
}
steps
{
script
{
docker
.
withRegistry
(
''
,
registryCredential
)
{
dockerImage
.
push
(
"latest"
)
dockerImage
.
push
(
"${version}"
)
}
}
}
}
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment