This commit is contained in:
Mateusz Piwowarski 2024-03-24 12:13:05 +01:00
parent 37cdcc397f
commit 47189ec4b8
3 changed files with 50 additions and 2 deletions

5
Jenkinsfile vendored
View File

@ -14,13 +14,14 @@ pipeline {
name: 'KAGGLE_KEY', name: 'KAGGLE_KEY',
) )
} }
stages { stages {
stage('Clone Repository') { stage('Clone Repository') {
steps { steps {
git branch: 'main', url: 'https://git.wmi.amu.edu.pl/s464913/ium_464913.git' git branch: 'main', url: 'https://git.wmi.amu.edu.pl/s464913/ium_464913.git'
} }
} }
stage('Download dataset') { stage('Download Dataset') {
steps { steps {
script { script {
withEnv (["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) { withEnv (["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
@ -30,7 +31,7 @@ pipeline {
} }
} }
} }
stage('Archive artifacts') { stage('Archive Artifacts') {
steps { steps {
archiveArtifacts artifacts: 'data/*', onlyIfSuccessful: true archiveArtifacts artifacts: 'data/*', onlyIfSuccessful: true
} }

12
stats.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# Count the number of lines in the original dataset
wc -l < creditcard_shuf.csv > stats.txt
# Count the number of lines in the training and testing datasets
wc -l < creditcard_train.csv > stats_train.txt
wc -l < creditcard_test.csv > stats_test.txt
# Create a directory for the data
mkdir -p data
# Move the statistics to the data directory
mv stats.txt stats_train.txt stats_test.txt data/

35
stats/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,35 @@
pipeline {
agent any
parameters {
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
}
stages {
stage('Clone Repository') {
steps {
git branch: 'main', url: 'https://git.wmi.amu.edu.pl/s464913/ium_464913.git'
}
}
stage('Copy Artifacts') {
steps {
copyArtifacts filter: 'data/*', projectName: 'z-s464913-create-dataset', selector: buildSelector('BUILD_SELECTOR')
}
}
stage('Generate Report') {
steps {
sh 'chmod +x stats.sh'
sh './stats.sh'
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts artifacts: 'data/*', onlyIfSuccessful: true
}
}
}
}