Fix W3AF pipeline docker image build

This commit is contained in:
wpetit 2019-12-26 13:42:51 +01:00
parent 19884e6719
commit d9799626f1

View File

@ -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}"