Keep build output between stages and jobs

20 views
Skip to first unread message

fabian

unread,
Nov 29, 2018, 7:40:11 AM11/29/18
to Jenkins Users
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

fabian

unread,
Nov 29, 2018, 8:47:19 AM11/29/18
to Jenkins Users
Looks like it might be a problem with out build system, not with Jenkins, sorry for that.
Still investigating...

Am Donnerstag, 29. November 2018 13:40:11 UTC+1 schrieb fabian:
Hi
Reply all
Reply to author
Forward
0 new messages