Added second jenkins file

This commit is contained in:
AWieczarek 2024-03-24 18:54:40 +01:00
parent 694db93a4e
commit 0750829580
4 changed files with 55 additions and 12 deletions

14
Jenkinsfile vendored
View File

@ -24,11 +24,15 @@ pipeline {
} }
} }
} }
} stage('Archive Results') {
post { steps {
always { archiveArtifacts artifacts: 'stats.txt', onlyIfSuccessful: true
archiveArtifacts artifacts: 'output.txt', onlyIfSuccessful: true,
deleteDir()
} }
} }
} }
// post {
// always {
// deleteDir()
// }
// }
}

38
Jenkinsfile-stats Normal file
View File

@ -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()
// }
// }
}

7
dataset_stats.sh Normal file
View File

@ -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

View File

@ -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 $((dev_lines + test_lines)) shuffled.csv | head -n $dev_lines > dev.csv
tail -n $test_lines shuffled.csv > test.csv tail -n $test_lines shuffled.csv > test.csv
# Archiwizacja
echo "------------------ Archive ------------------"
tar -czf artifacts.tar.gz train.csv dev.csv test.csv
# Czyszczenie # Czyszczenie
echo "------------------ Clean ------------------" echo "------------------ Clean ------------------"
rm cutoff_$DATASET_FILE shuffled.csv rm cutoff_$DATASET_FILE shuffled.csv
echo "artifacts.tar.gz"