Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xwiki-platform
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XWiki
xwiki-platform
Commits
bcdd668f
Commit
bcdd668f
authored
4 years ago
by
Vincent Massol
Browse files
Options
Downloads
Patches
Plain Diff
[Misc] Improve docker-latest trigger algorithm
parent
8067c050
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jenkinsfile
+9
-3
9 additions, 3 deletions
Jenkinsfile
with
9 additions
and
3 deletions
Jenkinsfile
+
9
−
3
View file @
bcdd668f
...
@@ -142,11 +142,17 @@ if (!params.type || params.type == 'standard') {
...
@@ -142,11 +142,17 @@ if (!params.type || params.type == 'standard') {
}
else
{
}
else
{
// If the build is docker-latest, only build if the previous build was triggered by some source code changes.
// If the build is docker-latest, only build if the previous build was triggered by some source code changes.
// Also always build if triggered manually by a user.
// Also always build if triggered manually by a user.
if
(
params
.
type
==
'docker-latest'
&&
(!
currentBuild
.
rawBuild
.
getCauses
()[
0
].
toString
().
contains
(
'UserIdCause'
)))
{
def
build
=
currentBuild
.
rawBuild
if
(!
currentBuild
.
rawBuild
.
getPreviousBuild
().
getChangeSets
().
isEmpty
())
{
def
cause
=
build
.
getCauses
()[
0
]
if
(
params
.
type
==
'docker-latest'
&&
(!
cause
.
toString
().
contains
(
'UserIdCause'
)))
{
// We trigger the build under two conditions:
// - The previous build has a non empty changeset (ie. there was some commit)
// - This build was triggered by an upstream job (like rendering triggering platform)
if
(!
build
.
getPreviousBuild
().
getChangeSets
().
isEmpty
()
||
cause
.
toString
().
contains
(
'UpstreamCause'
))
{
buildDocker
(
params
.
type
)
buildDocker
(
params
.
type
)
}
else
{
}
else
{
echoXWiki
"No changeset found in previous build, thus not executing the docker latest tests."
echoXWiki
"No changeset found in previous build and build not triggered by an upstream job, thus not executing \
the docker latest tests."
// Aborting so that the build isn't displayed as successful without doing anything.
// Aborting so that the build isn't displayed as successful without doing anything.
currentBuild
.
result
=
'ABORTED'
currentBuild
.
result
=
'ABORTED'
}
}
...
...
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