Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
apertis-image-recipes
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
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
Denis Pynkin
apertis-image-recipes
Commits
991beda0
Verified
Commit
991beda0
authored
6 years ago
by
Andrej Shadura
Browse files
Options
Downloads
Patches
Plain Diff
Allow building only selected images
Signed-off-by:
Andrej Shadura
<
andrew.shadura@collabora.co.uk
>
parent
910db90c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jenkinsfile
+28
-1
28 additions, 1 deletion
Jenkinsfile
with
28 additions
and
1 deletion
Jenkinsfile
+
28
−
1
View file @
991beda0
...
...
@@ -112,6 +112,33 @@ def architectures = [
]
]
properties
([
parameters
([
string
(
name:
'buildOnly'
,
defaultValue:
''
,
description:
'If set, only the selected images are built. Comma and slash separated, e.g. armhf/minimal, amd64/target'
,
trim:
true
),
])
])
def
buildCandidates
=
[:]
def
buildOnlyList
=
params
?.
buildOnly
.
tokenize
(
/, ?/
).
collect
{
it
.
tokenize
(
'/'
)
}
buildOnlyList
=
buildOnlyList
.
groupBy
{
it
[
0
]
}
.
collectEntries
{
arch
,
values
->
[
arch
,
values
.
findResults
{
it
[
1
]
}
]
}
buildCandidates
=
architectures
// filter out architectures which won't be built
.
subMap
(
buildOnlyList
.
keySet
())
.
collectEntries
{
arch
,
architecture
->
// filter out artifact types which won't be built
types
=
architecture
.
types
if
(
buildOnlyList
[
arch
])
types
=
architecture
.
types
.
subMap
(
buildOnlyList
[
arch
])
[
arch
,
architecture
+
[
types:
types
]]
}
// SSH complains loudly if the current user is not in the user database, so fake that
def
withSshAgent
(
credentials
,
command
)
{
sshagent
(
credentials:
[
credentials
,
]
)
{
...
...
@@ -478,7 +505,7 @@ def buildImages(architecture, type, boards, debosarguments = "", image = true, s
def
first_pass
=
[:]
def
second_pass
=
[:]
architectur
es
.
each
{
name
,
arch
->
buildCandidat
es
.
each
{
name
,
arch
->
arch
.
types
.
each
{
type
,
params
->
/* merge the per-arch default with per-type params */
def
merged
=
[:]
<<
arch
<<
params
...
...
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