diff --git a/Jenkinsfile_dataset_stats b/Jenkinsfile_dataset_stats index 9ebc346..d5dff92 100644 --- a/Jenkinsfile_dataset_stats +++ b/Jenkinsfile_dataset_stats @@ -1,17 +1,20 @@ pipeline { agent any - + properties([parameters([ + buildSelector( + defaultSelector: lastSuccessful(), + description: 'Which build to use for copying artifacts', + name: 'BUILD_SELECTOR') + ])]) stages { stage('copy artifacts') { steps { - copyArtifacts fingerprintArtifacts: true, projectName: 's470607-create-dataset', selector: lastSuccessful() + copyArtifacts fingerprintArtifacts: true, projectName: 's470607-create-dataset', selector: buildParameter('BUILD_SELECTOR') } } stage('stats') { steps { - sh 'wc -l train.csv > stats.txt' - sh 'wc -l test.csv >> stats.txt' - sh 'wc -l valid.csv >> stats.txt' + sh 'chmod +x dataset-stats.sh' } } stage('archive artifacts') { diff --git a/dataset-stats.sh b/dataset-stats.sh new file mode 100644 index 0000000..bae7856 --- /dev/null +++ b/dataset-stats.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sh 'wc -l train.csv > stats.txt' +sh 'wc -l test.csv >> stats.txt' +sh 'wc -l valid.csv >> stats.txt'