From fc056c2c4b889b5a240b71b15ed677722972ed0c Mon Sep 17 00:00:00 2001 From: piotrwrzodak Date: Fri, 21 Apr 2023 00:39:01 +0200 Subject: [PATCH] . --- Jenkinsfile-dataset-stats | 51 +++++++++++++++++++-------------------- dataset-stats.sh | 2 +- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/Jenkinsfile-dataset-stats b/Jenkinsfile-dataset-stats index 3dadd8a..74789cd 100644 --- a/Jenkinsfile-dataset-stats +++ b/Jenkinsfile-dataset-stats @@ -1,29 +1,28 @@ -pipeline { - agent any - parameters { - buildSelector( - defaultSelector: lastSuccessful(), - description: 'Which build to use for copying artifacts', - name: 'BUILD_SELECTOR' - ) +node { + stage('Preparation') { + properties([ + parameters([ + buildSelector( + defaultSelector: lastSuccessful(), + description: 'Which build to use for copying artifacts', + name: 'BUILD_SELECTOR' + ) + ]) + ]) + } + stage('checkout: Check out from version control') { + checkout scm } - stages { - stage('Copy Artifacts') { - steps { - copyArtifacts fingerprintArtifacts: true, projectName: 'z-s444510-create-dataset', selector: buildParameter('BUILD_SELECTOR') - } - } - stage('Calculate Dataset Statistics') { - steps { - sh 'chmod +x dataset-stats.sh' - sh './dataset-stats.sh' - } - post { - always { - archiveArtifacts artifacts: 'stats.txt', fingerprint: true - } - } - } + stage('Copy Artifacts') { + copyArtifacts fingerprintArtifacts: true, projectName: 'z-s444510-create-dataset', selector: buildParameter('BUILD_SELECTOR') } -} \ No newline at end of file + + stage('Calculate Dataset Statistics') { + sh 'chmod +x dataset-stats.sh' + sh './dataset-stats.sh' + } + stage('Save artefact') { + archiveArtifacts artifacts: 'stats.txt', fingerprint: true + } +} diff --git a/dataset-stats.sh b/dataset-stats.sh index d97d121..042e1c7 100644 --- a/dataset-stats.sh +++ b/dataset-stats.sh @@ -1,3 +1,3 @@ #!/bin/bash - +head barcelona_weekends.dev.csv cat barcelona_weekends.dev.csv | wc -l > stats.txt