diff --git a/Jenkinsfile b/Jenkinsfile index 90e6f9f..9bc8bfd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,11 +24,15 @@ pipeline { } } } - } - post { - always { - archiveArtifacts artifacts: 'output.txt', onlyIfSuccessful: true, - deleteDir() + stage('Archive Results') { + steps { + archiveArtifacts artifacts: 'stats.txt', onlyIfSuccessful: true + } } } +// post { +// always { +// deleteDir() +// } +// } } diff --git a/Jenkinsfile-stats b/Jenkinsfile-stats new file mode 100644 index 0000000..298d979 --- /dev/null +++ b/Jenkinsfile-stats @@ -0,0 +1,38 @@ +pipeline { + agent any + + parameters { + buildSelector( defaultSelector: lastSuccessful(), description: 'Which build to use for copying artifacts', name: 'BUILD_SELECTOR') + } + + stages { + stage('Clone Repository') { + steps { + git url: "https://git.wmi.amu.edu.pl/s464979/ium_464979.git" + } + } + stage('Copy Artifact') { + steps { + withEnv(["BUILD_SELECTOR=${params.BUILD_SELECTOR}" ]) { + copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464979-create-dataset', selector: buildParameter('$BUILD_SELECTOR')} + } + } + stage('Execute Shell Script') { + steps { + script { + sh "bash ./dataset_stats.sh" + } + } + } + stage('Archive Results') { + steps { + archiveArtifacts artifacts: 'stats.txt', onlyIfSuccessful: true + } + } + } +// post { +// always { +// deleteDir() +// } +// } +} diff --git a/dataset_stats.sh b/dataset_stats.sh new file mode 100644 index 0000000..6238e1d --- /dev/null +++ b/dataset_stats.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +wc -l beer_reviews.csv > stats_all.txt +wc -l train.csv > stats_train.txt +wc -l dev.csv > stats_dev.txt +wc -l test.csv > stats_test.txt + diff --git a/kuggle_download.sh b/kuggle_download.sh index 13fe451..fcc64c8 100644 --- a/kuggle_download.sh +++ b/kuggle_download.sh @@ -23,12 +23,6 @@ head -n $train_lines shuffled.csv > train.csv tail -n $((dev_lines + test_lines)) shuffled.csv | head -n $dev_lines > dev.csv tail -n $test_lines shuffled.csv > test.csv -# Archiwizacja -echo "------------------ Archive ------------------" -tar -czf artifacts.tar.gz train.csv dev.csv test.csv - # Czyszczenie echo "------------------ Clean ------------------" -rm cutoff_$DATASET_FILE shuffled.csv - -echo "artifacts.tar.gz" +rm cutoff_$DATASET_FILE shuffled.csv \ No newline at end of file