Hi
I'm converting older jobs from Jenkins 1.x to the pipeline system. Seems to work so far.
But I have a problem with temporary files.
The job mainly consists of the stages:
- update from svn
- build
- test1
- test2
...
I want to use the built files from stage 2 in the later stages. And preferably keep
the binaries even between job runs so I don't need to rebuild on every run. It should
be equivalent to
- svn update
- make
- sh test1
- sh test2
However all the created files get deleted between steps. I don't call any command
to clear the workspace or directories. How can I tell jenkins to not cleanup? Does
it have to do with the @tmp directories it keeps creating?
In general that's my script:
def DoBuild(target, config, build) {
dir('subdir') {
sh script: 'make'" || exit $?'
warnings ...
}
}
def DoTest(target, config, test) {
sh script: '$test' || exit $?'
xunit thresholds: [...]
}
pipeline {
stages {
stage('Checkout') {
steps {
checkout([$class: 'SubversionSCM'...])
}
}
stage('Build'){
steps {
DoBuild("tgt", "Debug", "build")
}
}
stage('Test 1'){
steps {
DoTest("tgt", "Debug", "test1")
}
}
stage('Test 2'){
steps {
DoTest("tgt", "Debug", "test2")
}
}
Thanks
bye Fabi