I have a question about declarative script syntax.


I have a multi-stage job, where each stage runs on a separate agent.
Whether the job passes or fails, I want to archive some artefacts from the
job, so I have to call archiveArtifacts from post::cleanup().



stages {

    stage(‘S1’) {

        agent { label “A” }

        steps {

        <snip>

    }

    stage(‘S2’) {

        agent { label “B” }

        steps {

        <snip>

    }

}

post {

    cleanup{ archiveArtifacts artifacts: '*.zip'}

}



My problem is that I want to archive the artifacts from a specific agent
(i.e. a specific stage). How would I do that?



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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAJK_iej6MzrtnHg-hf5p9SjsrHaNvJEDxkb3os6bdpTrRby4SQ%40mail.gmail.com.

Reply via email to