'make' exit code is ignored in declarative script

13 views
Skip to first unread message

David Aldrich

unread,
Jan 3, 2019, 12:19:40 PM1/3/19
to jenkins...@googlegroups.com
I have a declarative script that builds a C++ application on multiple agents in parallel.  A stage looks like:

        stage('build') {
            parallel {
                stage('znsim08') {
                    agent { label "znsim08" }

                    steps {
                        sh '''
                            make
                        '''

                        recordIssues minimumSeverity: 'HIGH', tools: [gcc4(id: 'centos5-warnings', name: 'Centos 5', pattern: 'build.log')]

                        archiveArtifacts 'build.log'
                    }
                }
etc.

I find that if make fails:

make[1]: *** [_gnuRelease/SINRCalculation.o] Error 1
make[1]: Leaving directory `/data/hudsonuser/workspace/gcc_all_versions/'
make: *** [../StarLibs/] Error 2

the stage still succeeds.  make's exit code seems to be ignored.

What am I missing?

Neil T

unread,
Jan 4, 2019, 6:05:06 AM1/4/19
to Jenkins Users
sh returnStatus: true, script: 'echo $foo'
Reply all
Reply to author
Forward
0 new messages