Add global wrapper to fix workspace permissions 45/345/3
authorFatih Degirmenci <fdegir@gmail.com>
Thu, 7 Feb 2019 09:58:44 +0000 (10:58 +0100)
committerFatih Degirmenci <fdegir@gmail.com>
Thu, 7 Feb 2019 10:48:10 +0000 (11:48 +0100)
Change-Id: I94008deb3d62d0aa5b69d8aceeab5385a38d4cd3
Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
jjb/global/jjb-macros.yaml

index 9630a91753560a8999cbfd9ddcd0d78d8b9c03b3..f19761d780f364003fd3f44ea05462ed12b99b19 100644 (file)
           timeout-var: 'BUILD_TIMEOUT'
           fail: true
 
+# wrapper to fix jenkins build workspace permissions
+- wrapper:
+    name: fix-workspace-permissions
+    wrappers:
+      - pre-scm-buildstep:
+          failOnError: true
+          buildsteps:
+            - shell: |
+                #!/bin/bash
+                sudo chown -R $USER:$USER $WORKSPACE || exit 1
+
 - publisher:
     name: notify-slack
     publishers: