Zad 03.Jenkins - BUILD_SELECTOR

This commit is contained in:
Cezary Gałązkiewicz 2022-03-28 01:18:43 +02:00
parent 7440bb587d
commit ea5f7a6a04

View File

@ -1,5 +1,12 @@
pipeline { pipeline {
agent any agent any
parameters {
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
}
stages { stages {
stage('Checkout') { stage('Checkout') {
steps { steps {
@ -8,7 +15,7 @@ pipeline {
} }
stage('Copy artifacts') { stage('Copy artifacts') {
steps { steps {
copyArtifacts fingerprintArtifacts: true, projectName: 's470623-create-dataset', selector: lastSuccessful() copyArtifacts fingerprintArtifacts: true, projectName: 's470623-create-dataset', selector: buildParameter('BUILD_SELECTOR')
sh 'chmod u+x ./stats.sh' sh 'chmod u+x ./stats.sh'
sh './stats.sh' sh './stats.sh'
} }