Reputation: 177
how do I store (Archive stage) artifacts to artifactory post jenkins build with SHA5 checksum in filename?
E.g. What I want as filename stored on artifactory:
sha__2340ursoddpkjfsodfj0429trjw0fjosdfkjsao90024r
.h
Artifactory checksum SHA-1: 2340ursoddpkjfsodfj0429trjw0fjosdfkjsao90024r
def server = Artifactory.server 'my-jfrog-artifactoryserver'
def uploadSp = """{
"files": [
{
"pattern": "*.h",
"target": "builds/myhfiles/"
}
]
}"""
node('h-builder')
{
{
stage ('Archive')
{
archiveArtifacts artifacts: '**/*.h', fingerprint: true
server.upload spec: uploadSp, failNoOp: true
}
}
}
Upvotes: 0
Views: 718
Reputation: 6063
You can try using Placeholders for this:
{
"files": [
{
"pattern": "(*).h",
"target": "builds/myhfiles/{1}"
}
]
}
Read more about File Specs greatness here and there.
Plugin documentation here.
Upvotes: 1