I need my Jenkins build to fail in case zero artifacts are uploaded into the artifactory.
I have included failNoOp into my upload spec but it seems it's not working in my Jenkinsfile. Here is my code:
def server = Artifactory.newServer url: env.ArtifactoryServerTEST, credentialsId:'ArtifactoryUATServerKey'
server.bypassProxy = true
def uploadSpec = """{
"files": [
{
"pattern": "final_artifacts/*.gz",
"target": "test/"
}
]
}"""
server.upload spec: uploadSpec, failNoOp: true
This needs to fail my build if none of the artifacts are uploaded into the artifactory, but it is giving me this error:
java.lang.IllegalArgumentException: Only the following arguments are allowed, [spec, buildInfo]
I'm using Artifactory OSS Version 6.2.0. anyone can help me on this?