diff --git a/Jenkinsfile-stats b/Jenkinsfile-stats new file mode 100644 index 0000000..7a319d8 --- /dev/null +++ b/Jenkinsfile-stats @@ -0,0 +1,29 @@ +pipeline { + agent any + + parameters { + choice(name: 'BUILD_SELECTOR', choices: '', description: 'Which build to use for copying artifacts') + } + + stages { + stage('Copy artifacts') { + steps { + script { + copyArtifacts fingerprintArtifacts: true, projectName: 's464906-create-dataset', selector: buildParameter('BUILD_SELECTOR') + } + } + } + stage('Run shell script') { + steps { + script { + sh './calculate_stats.sh' + } + } + post { + success { + archiveArtifacts artifacts: 'stats.txt', allowEmptyArchive: true + } + } + } + } +} diff --git a/calculate_stats.sh b/calculate_stats.sh new file mode 100644 index 0000000..06c6aa7 --- /dev/null +++ b/calculate_stats.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +wc -l result.txt > stats.txt