Skip to content

Commit 3bcadcd

Browse files
rbutcherjetersen
authored andcommitted
Fixing build issues
- Fixing haphazard changes to Docker.groovy - Fixing FindBugs issue with annotations on WindowsDockerClient.launch()
1 parent 348b1d9 commit 3bcadcd

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/main/java/org/jenkinsci/plugins/docker/workflow/client/WindowsDockerClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public Optional<String> getContainerIdIfContainerized() throws IOException, Inte
106106
private LaunchResult launch(@Nonnull EnvVars env, boolean quiet, FilePath workDir, String... args) throws IOException, InterruptedException {
107107
return launch(env, quiet, workDir, new ArgumentListBuilder(args));
108108
}
109-
private LaunchResult launch(@CheckForNull @Nonnull EnvVars env, boolean quiet, FilePath workDir, ArgumentListBuilder argb) throws IOException, InterruptedException {
109+
private LaunchResult launch(@Nonnull EnvVars env, boolean quiet, FilePath workDir, ArgumentListBuilder argb) throws IOException, InterruptedException {
110110
if (LOGGER.isLoggable(Level.FINE)) {
111111
LOGGER.log(Level.FINE, "Executing command \"{0}\"", argb);
112112
}

src/main/resources/org/jenkinsci/plugins/docker/workflow/Docker.groovy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ class Docker implements Serializable {
113113
public <V> V inside(String args = '', Closure<V> body) {
114114
docker.node {
115115
def toRun = imageName()
116-
if (toRun != id && docker.script."${shell()}"(script: "docker inspect -f . ${id}", returnStatus: true) == 0) {
116+
if (toRun != id && docker.script."${docker.shell()}"(script: "docker inspect -f . ${id}", returnStatus: true) == 0) {
117117
// Can run it without registry prefix, because it was locally built.
118118
toRun = id
119119
} else {
120-
if (docker.script."${shell()}"(script: "docker inspect -f . ${toRun}", returnStatus: true) != 0) {
120+
if (docker.script."${docker.shell()}"(script: "docker inspect -f . ${toRun}", returnStatus: true) != 0) {
121121
// Not yet present locally.
122122
// withDockerContainer requires the image to be available locally, since its start phase is not a durable task.
123123
pull()
@@ -131,13 +131,13 @@ class Docker implements Serializable {
131131

132132
public void pull() {
133133
docker.node {
134-
docker.script."${shell()}" "docker pull ${imageName()}"
134+
docker.script."${docker.shell()}" "docker pull ${imageName()}"
135135
}
136136
}
137137

138138
public Container run(String args = '', String command = "") {
139139
docker.node {
140-
def container = docker.script."${shell()}"(script: "docker run -d${args != '' ? ' ' + args : ''} ${id}${command != '' ? ' ' + command : ''}", returnStdout: true).trim()
140+
def container = docker.script."${docker.shell()}"(script: "docker run -d${args != '' ? ' ' + args : ''} ${id}${command != '' ? ' ' + command : ''}", returnStdout: true).trim()
141141
new Container(docker, container)
142142
}
143143
}
@@ -156,7 +156,7 @@ class Docker implements Serializable {
156156
public void tag(String tagName = parsedId.tag, boolean force = true) {
157157
docker.node {
158158
def taggedImageName = toQualifiedImageName(parsedId.userAndRepo + ':' + tagName)
159-
docker.script."${shell()}" "docker tag ${id} ${taggedImageName}"
159+
docker.script."${docker.shell()}" "docker tag ${id} ${taggedImageName}"
160160
return taggedImageName;
161161
}
162162
}
@@ -166,7 +166,7 @@ class Docker implements Serializable {
166166
// The image may have already been tagged, so the tagging may be a no-op.
167167
// That's ok since tagging is cheap.
168168
def taggedImageName = tag(tagName, force)
169-
docker.script."${shell()}" "docker push ${taggedImageName}"
169+
docker.script."${docker.shell()}" "docker push ${taggedImageName}"
170170
}
171171
}
172172

@@ -183,11 +183,11 @@ class Docker implements Serializable {
183183
}
184184

185185
public void stop() {
186-
docker.script."${shell()}" "docker stop ${id} && docker rm -f ${id}"
186+
docker.script."${docker.shell()}" "docker stop ${id} && docker rm -f ${id}"
187187
}
188188

189189
public String port(int port) {
190-
docker.script."${shell()}"(script: "docker port ${id} ${port}", returnStdout: true).trim()
190+
docker.script."${docker.shell()}"(script: "docker port ${id} ${port}", returnStdout: true).trim()
191191
}
192192
}
193193

0 commit comments

Comments
 (0)