Declarative script not archiving artefacts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Declarative script not archiving artefacts

David Aldrich-2

Hi

 

I have a declarative script that is not archiving the build artefacts. The structure of the script is:

 

pipeline {

    agent { label "sim07" }

    options { buildDiscarder(logRotator(numToKeepStr: '20')) }

 

    triggers {

        pollSCM('H 20 * * 1-5')

    }

 

    stages {

        stage('build_and_test') {

            steps {

                sh '''

                    /usr/bin/python3 -u my_regression_test.py

                '''

            }

 

            post {

                success {

                     emailext (subject: "${env.JOB_NAME}: Fixed!",

                               body: '${DEFAULT_CONTENT}',

                               recipientProviders: [[$class: 'CulpritsRecipientProvider']],

                              to: <snip>)

                     }

                failure {

                    script{ emailext (subject: "${env.JOB_NAME}: Failure!",

                                      body: '${DEFAULT_CONTENT}',

                                      recipientProviders: [[$class: 'CulpritsRecipientProvider']],

                                      to: <snip>)

                    }

                }

                unstable {

                    script{ emailext (subject: "${env.JOB_NAME}: Unstable!",

                                      body: '${DEFAULT_CONTENT}',

                                      to: <snip>)

                    }

                }

                always {

                    archiveArtifacts artifacts: '$WORKSPACE/RegressionTests/**/*.zip'

                }

            }

        }

    }

}

 

On the console output I see:

 

[Pipeline] archiveArtifacts

Archiving artifacts

[Pipeline] script

[Pipeline] {

[Pipeline] emailext

Sending email to: <snip>

[Pipeline] }

 

But no artefact files are listed (but they are present in the build directory).

 

Have I structured the ‘post’ section incorrectly?

 

Best regards

 

David

 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0d3410a9c9fc478989f86e0411da4d81%40EUX13SRV1.EU.NEC.COM.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Declarative script not archiving artefacts

Björn Pedersen

                always {

                    archiveArtifacts artifacts: '$WORKSPACE/RegressionTests/**/*.zip'


The artifacts should be  specified relative to the workspace, so the $WORKSPACE/ seems wrong. archiveArtifact will not archive files outside the current workspace
 
Björn

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/26229d4c-7cdc-46e5-b5c2-2b1221bcd69e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: Declarative script not archiving artefacts

David Aldrich-2

Thanks Björn

 

Removing $WORKSPACE/ fixed it.

 

Best regards

 

David

 

From: 'Björn Pedersen' via Jenkins Users [mailto:[hidden email]]
Sent: 18 January 2018 12:27
To: Jenkins Users <[hidden email]>
Subject: Re: Declarative script not archiving artefacts

 


                always {

                    archiveArtifacts artifacts: '$WORKSPACE/RegressionTests/**/*.zip'

 

The artifacts should be  specified relative to the workspace, so the $WORKSPACE/ seems wrong. archiveArtifact will not archive files outside the current workspace
 

Björn

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/26229d4c-7cdc-46e5-b5c2-2b1221bcd69e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Click here to report this email as spam.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1f72264450a04959bdd226e927fe19de%40EUX13SRV1.EU.NEC.COM.
For more options, visit https://groups.google.com/d/optout.