How to insert date and time to a filename in a batch script?
Deploying application via Ansible playbook without bringing both sides down
Can Jenkins detect when a new build is available on a Bamboo server?
How to send an automated email based on time from last successful jenkins build
rtDownload ( //
serverId: 'MAIN-ARTIFACTORY',
spec: '''{ "files": [{"pattern": "p1/p2/p3/${BUILD_ID}/n_iter.txt", "target": "./n_iter.txt"}] }''',
where BUILD_ID = 'a/b'
downloads file to a location $WORKSPACE/p2/p3/a/b/n_iter.txt rather then expected $WORKSPACE/n_iter.txt
Also, very strange - why p1 is not in downloaded path?
Accepted answer
By default, artifacts are downloaded to the target path in the file system while maintaining their hierarchy in the source repository (not including the repository name - hence
p1
is missing in your example).
To download an artifact while ignoring the hierarchy, set
"flat": "true"
in your file spec.
For a more advanced control of the resulting hierarchy, you may want to use
Placeholders
.
See more information in the
File Specs documentation
.
Please try with the below snippet, which means all the files in the
com/my-files/
Artifactory repository-path will be downloaded into the
my-folder
directory on the Jenkins agent file system. For more details on this please do refer to our Declarative Pipeline Syntax wiki page
here
.
rtDownload (
serverId: 'Artifactory-1',
spec: '''{
"files": [
"pattern": "com/my-files/",
"target": "my-folder/"
In addition to the above, you can refer to the rtDownload example referred to in our GitHub page here.
Related Query
How to properly use target of artifactory rtDownload in jenkins declarative pipeline
How to use an environment variable in the agent section of a Jenkins Declarative Pipeline?
How to use @Library in an imported groovy script in Jenkins declarative pipeline?
How to use groovy to populate an env variable in a declarative jenkins pipeline
How to use Jenkins declarative pipeline to build and test on multiple platforms
How to use Throttle Concurrent Builds in Jenkins Declarative Pipelines
Declarative Jenkins Pipeline; How to declare a variable and use it in script or mail notification?
How do I use Docker's --cache-from build flag in a declarative Jenkins pipeline?
How can I use Jar produced by mvn package in another Jenkins declarative pipeline stage?
Jenkins Date Parameter Plugin - How to use it in a Declarative Pipeline
How to replace Artifactory File Spec "Spec Vars" from Jenkins Declarative Pipeline
How can I use different private docker agents based on parameter in Jenkins declarative pipeline?
How do I use a jenkins declarative pipeline credential and convert to a powershell credential?
How to upload a file using Jenkins Declarative Pipeline to Artifactory
How to use conditions in Jenkins declarative pipeline "options" block?
Jenkins Declarative Pipeline: How to use arguments passed into function in Windows bat command?
How to use file parameter in Jenkins declarative pipeline?
How to use choice parameter integer value as array in Jenkins Declarative pipeline file
How to use Random number in Jenkins Declarative pipeline
How to use Artifactory Maven Build in Jenkins Pipeline
How to use for loop with def list in Jenkins declarative pipeline
How to download the LATEST artifact from jfrog Artifactory repository to jenkins declarative pipeline without plugin using Curl command?
How to use conditions in Jenkins multibranch declarative pipeline "options" block?
How to properly use Jenkins crumbs in an HTML form
How to use heavyweight post with Jenkins declarative pipeline while running pipeline on lightweight executor
How to use Jenkins P4 plugin publish for declarative pipeline
How do I pass variables between stages in a declarative Jenkins pipeline?
How to create methods in Jenkins Declarative pipeline?
How to use multiple credentials in withCredentials in Jenkins Pipeline
How to define and use function inside Jenkins Pipeline config?
How to lock multiple stages of declarative Jenkins pipeline?
How do I use Jenkins Pipeline properties step?
How to run multiple stages on the same node with declarative Jenkins pipeline?
How to use Github Personal Access Token in Jenkins
How can I set up Jenkins CI to use https on Windows?
How to connect Bitbucket to Jenkins properly
How to set PATH in Jenkins Declarative Pipeline
How do I Extract Version ID from POM inside Jenkins Declarative and Scripted pipelines?
How to use post steps with Jenkins pipeline on multiple agents?
How to use a Jenkins variable in my Powershell Script
Jenkins Declarative Pipeline: How to read choice from input step?
How to do simple if-statements inside a declarative pipeline in Jenkins
How can I use the Extended Choice Parameter plugin in a Jenkins pipeline script?
How to continue past a failing stage in Jenkins declarative pipeline syntax
How to use source command within Jenkins pipeline script
How to use Jenkins parameters in a shell script
How to dynamically pick a git branch to use in Jenkins build
How to use Jenkins parameterized builds?
Jenkins - How to get and use upstream info in downstream
How to write properly an if statement in regards to a BooleanParameter in Jenkins pipeline Jenkinsfile?
More Query from same tag
SonarQube + Jenkins not producing Unit Tests Coverage
Saving AWS instance IP address to variable in groovy script fails build
Scp command to copy the particular folder without recursively
Jenkins java.io.NotSerializableException when running slave on AWS ECS
How to give "build run" Permission on a specific job to a user in Jenkins
How to Pass downstream parameter ( e.g Current build parameter ) to downstream job of Jenkins. How to write Scripted pipeline for the same?
Jenkins on AWS: No valid crumb was included in the request
Loading class in Jenkins : No such property for class
Jenkins: Trigger Multi-branch pipeline on upstream change
The second command doesn't run as root
How to customize Jenkins build name?
How to list all `env` properties within jenkins pipeline job?
Find view name from jenkins GUI given the job details
How to use a set of jar files in classpath in Jenkins
Do not print Maven Goals and options command to Console Output in Jenkins
Jenkins test mail configuration error. java connection error
Adding SCM credentials to jobs created through DSL in Jenkins
Is it possible to copy files before and after some command execution from installer to user's machine in Advanced Installer?
Jenkins pipeline mvn Package command not working
Fixing Jenkins privileges on build
Jenkins - trigger job if one of other projects was pulled by SCM
how to switching working copy in jenkins?
Jenkins: Run Serenity acceptance tests without failure
Can SonarQube be used for SAST for a dot net core version 3.2 application?
git flow branching model... how does 'qa' branch fit in, with jenkins auto deploy?
Install Jenkins Plugins with Ansible
Accessing SCM (Git) variables on a Jenkins Pipeline job
Is it possible to use git hub login for local sonar application?
How to make HTTP call to jenkins build with parameters then fetch output of running job triggered by that call?
Jenkins stash is not stashing all files and folders
How is this nested Groovy statement interpreted in terms of the arguments of `timeout()`?
How to start Docker daemon inside a Docker container using supervisord?
Git like change and version management of complete machine
Multiple IBM Rhapsody Processes not working in Jenkins Running as Windows Service
Bind mount file with destination relative to USER's home