pipeline { agent any parameters { buildSelector( name: 'BUILD_SELECTOR', description: 'Which build to use for copying artifacts', defaultSelector: lastSuccessful() ) } stages { stage('Git Checkout') { steps { git 'https://git.wmi.amu.edu.pl/s360792/ium_z360792.git' } } stage('Copy Artifacts') { steps { copyArtifacts( fingerprintArtifacts: true, projectName: 'z-s360792-create-dataset', selector: buildParameter('BUILD_SELECTOR') ) } } stage('Run Shell Script') { steps { sh 'chmod +x stats.sh' sh './stats.sh' } } stage('Archive Artifacts') { steps { archiveArtifacts artifacts: 'results.txt', onlyIfSuccessful: true } } } }