-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins ver. 2.115
Artifactory Plugin 2.16.1
With the config below in declarative pipeline syntax
stage('Deploy Dev') { environment { DEPLOY_TO = 'dev' } when { branch 'master' } steps { echo "deploying release from artifactory into ${env.DEPLOY_TO}" // Fetch from Artifactory. script { def downloadSpec = """{ "files": [ { "pattern": "repo-sbt-snapshots/uk/org/${projectName}/${BUILD_NUMBER}/*.jar", "target": "dist" } ] }""" server.download downloadSpec } // deploy } }
I get the following output:
Successfully downloaded 'http://hostname/artifactory/repo-sbt-snapshots/uk/org/sbr-ci-poc/49/ci-poc_2.11-0.2.49.jar' to '/var/lib/jenkins/workspace/er_GitLab_sbr-ci-poc_master-TKMSAR453MMTFPKYYB5VLQTLHZ4ZY6OK4UZKJVMB63Z6WTPG5XZQ/dist/uk/org/sbr-ci-poc/49/'
However, if I run
find . -type f -name '*.jar'
there's no trace of it in the workspace. The same block of code works in scripted mode.
So, the issue was the missing slash in the download target path. Stupid on my part, but potentially should have been caught by the plugin? At a minimum this should be documented.