File tree Expand file tree Collapse file tree 2 files changed +2
-54
lines changed Expand file tree Collapse file tree 2 files changed +2
-54
lines changed Original file line number Diff line number Diff line change 11
11
// In "Additional Behaviours", enable "Checkout to specific local branch"
12
12
// and leave "Branch name" empty.
13
13
// Not needed for multi-branch pipelines which already BRANCH_NAME in the environment.
14
- import hudson.model.*
15
14
16
15
def gitBranch = " "
17
16
def tarballgz
18
17
def tarballbz2
19
18
def statusHasChanged = false
20
19
21
- def filterAvailableNode (nodeList ) {
22
- def nodeToDelete = []
23
- nodeList. each { node ->
24
- echo " Searching for $node " ;
25
- if (node != null ) {
26
- computer = Jenkins . instance. getNode(node). toComputer();
27
- if (computer. isOffline()) {
28
- echo " Error: $node is offline." ;
29
- nodeToDelete. add(node);
30
- }
31
- }
32
- else {
33
- echo " Error: $node not found!" ;
34
- nodeToDelete. add(node);
35
- }
36
- }
37
-
38
- return nodeList. findAll { ! nodeToDelete. contains(it) }
39
- }
40
-
41
20
pipeline {
42
21
agent none
43
22
@@ -70,12 +49,7 @@ pipeline {
70
49
script {
71
50
listOfNodeNames = []
72
51
if (env. NO_UNIX != ' true' ) {
73
- labelToSelect = ' unix'
74
- listOfNodeNames = jenkins.model.Jenkins . instance. nodes. collect {
75
- node -> node. getLabelString(). contains(labelToSelect) ? node. name : null
76
- }
77
- listOfNodeNames. removeAll(Collections . singleton(null ))
78
- listOfNodeNames = filterAvailableNode(listOfNodeNames)
52
+ listOfNodeNames = nodesByLabel(' unix' )
79
53
}
80
54
if (env. NO_MSVC != ' true' ) {
81
55
listOfNodeNames. push(' VisualStudio' )
Original file line number Diff line number Diff line change 13
13
// In "Additional Behaviours", enable "Checkout to specific local branch"
14
14
// and leave "Branch name" empty.
15
15
// Not needed for multi-branch pipelines which already BRANCH_NAME in the environment.
16
- import hudson.model.*
17
16
18
17
def gitRepoURL = " "
19
18
def gitBranch = " "
20
19
def tarballgz
21
20
def tarballbz2
22
21
def statusHasChanged = false
23
22
24
- def filterAvailableNode (nodeList ) {
25
- def nodeToDelete = []
26
- nodeList. each { node ->
27
- echo " Searching for $node " ;
28
- if (node != null ) {
29
- computer = Jenkins . instance. getNode(node). toComputer();
30
- if (computer. isOffline()) {
31
- echo " Error: $node is offline." ;
32
- nodeToDelete. add(node);
33
- }
34
- }
35
- else {
36
- echo " Error: $node not found!" ;
37
- nodeToDelete. add(node);
38
- }
39
- }
40
-
41
- return nodeList. findAll { ! nodeToDelete. contains(it) }
42
- }
43
-
44
23
pipeline {
45
24
agent none
46
25
@@ -83,12 +62,7 @@ pipeline {
83
62
script {
84
63
listOfNodeNames = []
85
64
if (env. NO_UNIX != ' true' ) {
86
- labelToSelect = ' unix'
87
- listOfNodeNames = jenkins.model.Jenkins . instance. nodes. collect {
88
- node -> node. getLabelString(). contains(labelToSelect) ? node. name : null
89
- }
90
- listOfNodeNames. removeAll(Collections . singleton(null ))
91
- listOfNodeNames = filterAvailableNode(listOfNodeNames)
65
+ listOfNodeNames = nodesByLabel(' unix' )
92
66
}
93
67
if (env. NO_MINGW != ' true' ) {
94
68
listOfNodeNames. push(' MinGW' )
You can’t perform that action at this time.
0 commit comments