From ea5f7a6a044d152c72e6f9376d0f60040a10422a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Ga=C5=82=C4=85zkiewicz?= Date: Mon, 28 Mar 2022 01:18:43 +0200 Subject: [PATCH] Zad 03.Jenkins - BUILD_SELECTOR --- Jenkinsfile_stats | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile_stats b/Jenkinsfile_stats index 628f3cb..b76e432 100644 --- a/Jenkinsfile_stats +++ b/Jenkinsfile_stats @@ -1,5 +1,12 @@ pipeline { agent any + parameters { + buildSelector( + defaultSelector: lastSuccessful(), + description: 'Which build to use for copying artifacts', + name: 'BUILD_SELECTOR' + ) + } stages { stage('Checkout') { steps { @@ -8,7 +15,7 @@ pipeline { } stage('Copy artifacts') { 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 './stats.sh' }