diff --git a/vars/audit.groovy b/vars/audit.groovy index c1049e9..6b7315d 100644 --- a/vars/audit.groovy +++ b/vars/audit.groovy @@ -186,11 +186,18 @@ def call() { def buildDockerImage() { dir ('.w3af') { - def dockerfile = libraryResource 'com/cadoles/w3af/Dockerfile' - writeFile file:'Dockerfile', text:dockerfile - def audit = libraryResource 'com/cadoles/w3af/audit.w3af.tmpl' - writeFile file:'audit.w3af.tmpl', text:audit + def resourceFiles = [ + 'com/cadoles/w3af/audit.w3af.tmpl', + 'com/cadoles/w3af/Dockerfile', + 'com/cadoles/w3af/run-audit.sh' + ]; + + for (res in resourceFiles) { + def fileContent = libraryResource res + def fileName = res.substring(res.lastIndexOf("/")+1) + writeFile file:fileName, text:fileContent + } def safeJobName = URLDecoder.decode(env.JOB_NAME).toLowerCase().replace('/', '-').replace(' ', '-') def imageTag = "${safeJobName}-${env.BUILD_ID}"