Fix W3AF pipeline docker image build

This commit is contained in:
wpetit 2019-12-26 13:42:51 +01:00
parent 19884e6719
commit d9799626f1
1 changed files with 11 additions and 4 deletions

View File

@ -186,11 +186,18 @@ def call() {
def buildDockerImage() { def buildDockerImage() {
dir ('.w3af') { dir ('.w3af') {
def dockerfile = libraryResource 'com/cadoles/w3af/Dockerfile'
writeFile file:'Dockerfile', text:dockerfile
def audit = libraryResource 'com/cadoles/w3af/audit.w3af.tmpl' def resourceFiles = [
writeFile file:'audit.w3af.tmpl', text:audit '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 safeJobName = URLDecoder.decode(env.JOB_NAME).toLowerCase().replace('/', '-').replace(' ', '-')
def imageTag = "${safeJobName}-${env.BUILD_ID}" def imageTag = "${safeJobName}-${env.BUILD_ID}"