Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
b9b93243
Commit
b9b93243
authored
May 09, 2018
by
Dominik Charousset
Committed by
Joseph Noir
May 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flatten pipeline into a single parallel block
parent
7f772be7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
57 deletions
+52
-57
Jenkinsfile
Jenkinsfile
+52
-57
No files found.
Jenkinsfile
View file @
b9b93243
...
...
@@ -109,39 +109,39 @@ def buildSteps(buildType, cmakeArgs) {
if
(
STAGE_NAME
.
contains
(
'Windows'
))
{
echo
"Windows build on $NODE_NAME"
withEnv
([
'PATH=C:\\Windows\\System32;C:\\Program Files\\CMake\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git\\bin'
])
{
// Configure and build.
def
ret
=
bat
(
returnStatus:
true
,
script:
"""cmake -E make_directory build
cd build
cmake -D CMAKE_BUILD_TYPE=$buildType -G "Visual Studio 15 2017" $cmakeArgs $msOpts ..
IF /I "%ERRORLEVEL%" NEQ "0" (
EXIT 1
)
EXIT 0"""
)
if
(
ret
)
{
echo
"[!!!] Configure failed!"
currentBuild
.
result
=
'FAILURE'
return
}
// bat "echo \"Step: Build for '${tags}'\""
ret
=
bat
(
returnStatus:
true
,
script:
"""cd build
cmake --build .
IF /I "%ERRORLEVEL%" NEQ "0" (
EXIT 1
)
EXIT 0"""
)
if
(
ret
)
{
echo
"[!!!] Build failed!"
currentBuild
.
result
=
'FAILURE'
return
}
// Test.
ctest
([
arguments:
'--output-on-failure'
,
installation:
'cmake auto install'
,
workingDir:
'build'
,
])
// Configure and build.
def
ret
=
bat
(
returnStatus:
true
,
script:
"""cmake -E make_directory build
cd build
cmake -D CMAKE_BUILD_TYPE=$buildType -G "Visual Studio 15 2017" $cmakeArgs $msOpts ..
IF /I "%ERRORLEVEL%" NEQ "0" (
EXIT 1
)
EXIT 0"""
)
if
(
ret
)
{
echo
"[!!!] Configure failed!"
currentBuild
.
result
=
'FAILURE'
return
}
// bat "echo \"Step: Build for '${tags}'\""
ret
=
bat
(
returnStatus:
true
,
script:
"""cd build
cmake --build .
IF /I "%ERRORLEVEL%" NEQ "0" (
EXIT 1
)
EXIT 0"""
)
if
(
ret
)
{
echo
"[!!!] Build failed!"
currentBuild
.
result
=
'FAILURE'
return
}
// Test.
ctest
([
arguments:
'--output-on-failure'
,
installation:
'cmake auto install'
,
workingDir:
'build'
,
])
}
}
else
{
echo
"Unix build on $NODE_NAME"
...
...
@@ -171,28 +171,22 @@ def buildSteps(buildType, cmakeArgs) {
}
// Builds a stage for given builds. Results in a parallel stage `if builds.size() > 1`.
def
makeBuildStage
(
builds
,
lblExpr
,
settings
)
{
if
(
builds
.
size
()
==
1
)
{
def
buildType
=
builds
[
0
]
return
{
node
(
lblExpr
)
{
stage
(
"$lblExpr: $buildType"
)
{
withEnv
(
buildEnvironments
[
lblExpr
]
?:
[])
{
buildSteps
(
buildType
,
settings
[
'cmakeArgs'
]
?:
''
)
(
settings
[
'extraSteps'
]
?:
[]).
each
{
fun
->
"$fun"
()
}
def
makeBuildStages
(
matrixIndex
,
builds
,
lblExpr
,
settings
)
{
builds
.
collectEntries
{
buildType
->
def
id
=
"$matrixIndex $lblExpr: $buildType"
[
(
id
):
{
node
(
lblExpr
)
{
stage
(
id
)
{
withEnv
(
buildEnvironments
[
lblExpr
]
?:
[])
{
buildSteps
(
buildType
,
settings
[
'cmakeArgs'
]
?:
''
)
(
settings
[
'extraSteps'
]
?:
[]).
each
{
fun
->
"$fun"
()
}
}
}
}
}
}
}
return
{
node
(
'master'
)
{
stage
(
"$lblExpr: Fan Out"
)
{
parallel
builds
.
collectEntries
{
buildType
->
[
"$lblExpr: $buildType"
:
makeBuildStage
([
buildType
],
lblExpr
,
settings
)]
}
}
}
]
}
}
...
...
@@ -220,15 +214,16 @@ pipeline {
stage
(
'Builds'
)
{
steps
{
script
{
// Create stages for
our building everything in our build
//
matrix in
parallel.
// Create stages for
building everything in our build matrix in
// parallel.
def
xs
=
[:]
buildMatrix
.
eachWithIndex
{
entry
,
index
->
def
(
os
,
settings
)
=
entry
settings
[
'tools'
].
eachWithIndex
{
tool
,
toolIndex
->
def
labelExpr
=
"$os && $tool"
def
builds
=
settings
[
'builds'
]
xs
[
"Build $os [$index:$toolIndex]"
]
=
makeBuildStage
(
builds
,
labelExpr
,
settings
)
def
matrixIndex
=
"[$index:$toolIndex]"
def
builds
=
settings
[
'builds'
]
def
labelExpr
=
"$os && $tool"
xs
<<
makeBuildStages
(
matrixIndex
,
builds
,
labelExpr
,
settings
)
}
}
parallel
xs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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