From 7feb78d4f21402790c153aa8f6133ab35c3e9c3d Mon Sep 17 00:00:00 2001 From: jakubknczny Date: Sun, 28 Mar 2021 18:27:27 +0200 Subject: [PATCH] add script for dataset-stats --- Jenkinsfile_dataset_stats | 13 ++++++++----- dataset-stats.sh | 5 +++++ 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 dataset-stats.sh 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'