We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d1c8bd commit 16b398aCopy full SHA for 16b398a
vars/withChownWorkspace.groovy
@@ -5,7 +5,12 @@ def call(Closure body=null) {
5
} finally {
6
try {
7
echo "chowning workspace"
8
- sh 'docker run --rm -v $(pwd):/workspace busybox chown -R "$(id -u):$(id -g)" /workspace'
+ def arch = sh(script: "docker version -f '{{ .Server.Arch }}'", returnStdout: true).trim()
9
+ def image = "busybox"
10
+ if (arch == "arm") {
11
+ image = "armhf/busybox"
12
+ }
13
+ sh "docker run --rm -v \$(pwd):/workspace ${image} chown -R \"\$(id -u):\$(id -g)\" /workspace"
14
} catch (Exception e) {
15
println e
16
}
0 commit comments