I wrote a Jenkins pipeline to download the artifcats from JFrog. I have artifactory plugin for Jenkins so I use rtdownload. Below is the rtdownload section
rtDownload (
serverId: 'pe-jfrog',
spec: '''{
"files": [
{
"pattern": "my-local-repo-dev/test-${buildVersion}.tar"
}
]
}''',
buildName: 'my-test-build',
buildNumber: "${env.buildVersion}"
)
I use choice parameter to get buildversion. With this I'm able to download.
Now my requirement is how can I pass the value to pattern
I decalred variable as def jfrogrepo = "my-local-repo/test-${buildVersion}.tar"
I tried to call this variable as
- "pattern" : "${jfrogrepo}"
- "pattern" : jfrogrepo
None of it works.But on echoing the variable I'm getting correct output.
So is there a way to pass variable to pattern or is there any other way to download the artifacts by making use of the artifacory plugin.