I have a Jenkins multibranch pipeline which is polling periodically my svn for new commits. Running the pipeline, multiple log files are created which are saved in workspace directory (which will be cleaned for each new pipeline build). To save them durably I want to move the files to the builds directory of Jenkins where all build specific jenkins-logs, etc. are saved too. The default path in my file directory is:
...\${JENKINS_HOME}\jobs\*name-multibranch-job*\branches\*a-cryptic-name*\builds\*build-number*\
This path is specified in the file ...\${JENKINS_HOME}\config.xml
as
<hudson>
...
<buildsDir>${ITEM_ROOTDIR}/builds</buildsDir>
...
</hudson>
How can I access this value in my Pipeline script to move my log files via robocopy? The variables ${ITEM_ROOTDIR}
and ${ITEM_FULL_NAME}
(see https://wiki.jenkins.io/display/JENKINS/Features+controlled+by+system+properties) are e.g. not recognized in pipeline script:
No such property: ITEM_FULL_NAME for class: WorkflowScript