diff --git a/Jenkinsfile b/Jenkinsfile index 8107c6b..dfde3a4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,13 +14,14 @@ pipeline { name: 'KAGGLE_KEY', ) } + stages { stage('Clone Repository') { steps { git branch: 'main', url: 'https://git.wmi.amu.edu.pl/s464913/ium_464913.git' } } - stage('Download dataset') { + stage('Download Dataset') { steps { script { withEnv (["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) { @@ -30,7 +31,7 @@ pipeline { } } } - stage('Archive artifacts') { + stage('Archive Artifacts') { steps { archiveArtifacts artifacts: 'data/*', onlyIfSuccessful: true } diff --git a/stats.sh b/stats.sh new file mode 100644 index 0000000..5b58174 --- /dev/null +++ b/stats.sh @@ -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/ \ No newline at end of file diff --git a/stats/Jenkinsfile b/stats/Jenkinsfile new file mode 100644 index 0000000..6fbda07 --- /dev/null +++ b/stats/Jenkinsfile @@ -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 + } + } + } +} \ No newline at end of file