pipeline { agent any parameters { buildSelector( defaultSelector: lastSuccessful(), description: 'Which build to use for copying artifacts', name: 'BUILD_SELECTOR' ) } stages { stage('CopyArtifacts') { steps { copyArtifacts fingerprintArtifacts: true, projectName: 's478815-creat-datasets', selector: buildParameter('BUILD_SELECTOR') sh "chmod +x -R ${env.WORKSPACE}" sh './skrypt_stats.sh' } } stage('Archive') { steps { archiveArtifacts 'data.csv.shuf.uptd' } } } }