Skip to content

Commit e1fdff8

Browse files
committed
jobs: make pipeutils, pipecfg, and libcloud script globals
In Groovy, variables declared at the topmost scope of the script with `def` are accessible to the rest of the script and inner scopes. But any function declared in the script is considered a separate scope and will not have access to these variables. I'd like to introduce functions and have those functions have access to `pipeutils` and `pipecfg`. Since these are generic "immutable" (though not enforced) variables, let's drop the `def` for them so that they're "script global".
1 parent 2e993b4 commit e1fdff8

15 files changed

+15
-15
lines changed

jobs/build-arch.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import org.yaml.snakeyaml.Yaml;
22

3-
def pipeutils, pipecfg, libcloud
43
node {
54
checkout scm
5+
// these are script global vars
66
pipeutils = load("utils.groovy")
77
pipecfg = pipeutils.load_pipecfg()
88
libcloud = load("libcloud.groovy")

jobs/build-cosa.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
def pipeutils
21
def gitref, commit, shortcommit
32
def containername = 'coreos-assembler'
43
node {
54
checkout scm
5+
// these are script global vars
66
pipeutils = load("utils.groovy")
77
}
88

jobs/build-development.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
def pipecfg, pipeutils
21
node {
32
checkout scm
3+
// these are script global vars
44
pipeutils = load("utils.groovy")
55
pipecfg = pipeutils.load_pipecfg()
66
}

jobs/build-fcos-buildroot.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
def pipeutils
21
def gitref, commit, shortcommit
32
def containername = 'fcos-buildroot'
43
node {
54
checkout scm
5+
// these are script global vars
66
pipeutils = load("utils.groovy")
77
pipecfg = pipeutils.load_pipecfg()
88
}

jobs/build-mechanical.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
def pipecfg, pipeutils
21
node {
32
checkout scm
3+
// these are script global vars
44
pipeutils = load("utils.groovy")
55
pipecfg = pipeutils.load_pipecfg()
66
}

jobs/build.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import org.yaml.snakeyaml.Yaml;
22

3-
def pipeutils, pipecfg, libcloud
43
node {
54
checkout scm
5+
// these are script global vars
66
pipeutils = load("utils.groovy")
77
pipecfg = pipeutils.load_pipecfg()
88
libcloud = load("libcloud.groovy")

jobs/bump-lockfile.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
def pipeutils, pipecfg
21
node {
32
checkout scm
3+
// these are script global vars
44
pipeutils = load("utils.groovy")
55
pipecfg = pipeutils.load_pipecfg()
66
}

jobs/cloud-replicate.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
def pipeutils, pipecfg, libcloud
21
node {
32
checkout scm
3+
// these are script global vars
44
pipeutils = load("utils.groovy")
55
pipecfg = pipeutils.load_pipecfg()
66
libcloud = load("libcloud.groovy")

jobs/kola-aws.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
def pipeutils, pipecfg
21
node {
32
checkout scm
3+
// these are script global vars
44
pipeutils = load("utils.groovy")
55
pipecfg = pipeutils.load_pipecfg()
66
}

jobs/kola-azure.Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
def pipeutils, pipecfg
21
node {
32
checkout scm
3+
// these are script global vars
44
pipeutils = load("utils.groovy")
55
pipecfg = pipeutils.load_pipecfg()
66
}

0 commit comments

Comments
 (0)