From 5dd7412a27a39c4a2369c42d14709d8afdf057dd Mon Sep 17 00:00:00 2001 From: s464953 Date: Mon, 25 Mar 2024 21:46:01 +0100 Subject: [PATCH] added stats scipt --- Jenkinsfile-stats | 42 ++++++++++++++++++++++++++++++++++++++++++ dataset_stats.sh | 13 +++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Jenkinsfile-stats create mode 100644 dataset_stats.sh diff --git a/Jenkinsfile-stats b/Jenkinsfile-stats new file mode 100644 index 0000000..08db9ce --- /dev/null +++ b/Jenkinsfile-stats @@ -0,0 +1,42 @@ +pipeline { + agent any + + parameters { + buildSelector( defaultSelector: lastSuccessful(), description: 'Build for copying artifacts', name: 'BUILD_SELECTOR') + } + + stages { + stage('Clone Repository') { + steps { + git 'https://git.wmi.amu.edu.pl/s464953/ium_464953.git' + } + } + stage('Cleanup Artifacts') { + steps { + script { + sh 'rm -rf artifacts' + } + } + } + stage('Copy Artifact') { + steps { + withEnv([ + "BUILD_SELECTOR=${params.BUILD_SELECTOR}" + ]) { + copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464953-create-dataset', selector: buildParameter('$BUILD_SELECTOR')} + } + } + stage('Execute Shell Script') { + steps { + script { + sh "bash ./dataset_stats.sh" + } + } + } + stage('Archive Results') { + steps { + archiveArtifacts artifacts: 'artifacts/*', onlyIfSuccessful: true + } + } + } +} \ No newline at end of file diff --git a/dataset_stats.sh b/dataset_stats.sh new file mode 100644 index 0000000..d138dcb --- /dev/null +++ b/dataset_stats.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "------------------ Train dataset stats ------------------" +wc -l artifacts/train.csv > stats_train.txt + +echo "------------------ Validation dataset stats ------------------" +wc -l artifacts/validation.csv > stats_validation.txt + +echo "------------------ Test dataset stats ------------------" +wc -l artifacts/test.csv > stats_test.txt + +mkdir -p data +mv stats_train.txt stats_validation.txt stats_test.txt artifacts/ \ No newline at end of file