From 4cacd1a13e4e1e888741e243f13874231fc8d290 Mon Sep 17 00:00:00 2001 From: s464906 Date: Tue, 26 Mar 2024 22:07:25 +0100 Subject: [PATCH] added Jenkinsfile-stats and calculate_stats.sh --- Jenkinsfile-stats | 29 +++++++++++++++++++++++++++++ calculate_stats.sh | 3 +++ 2 files changed, 32 insertions(+) create mode 100644 Jenkinsfile-stats create mode 100644 calculate_stats.sh 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