Added shell script and modified Jenkinsfile

This commit is contained in:
Wojciech Lidwin 2023-03-26 16:26:14 +02:00
parent 3c587d17f5
commit 4b70c31b51
2 changed files with 16 additions and 2 deletions

11
Jenkinsfile vendored
View File

@ -16,12 +16,19 @@ node {
])
])
}
stage('Build') {
stage('checkout: Check out from version control') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 's487197', url: 'https://git.wmi.amu.edu.pl/s487197/ium_487197']]])
}
stage('Shell Script') {
// Run the maven build
sh 'chmod u+x download_dataset.sh'
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
sh 'kaggle datasets list'
sh './download_dataset.sh'
archiveArtifacts artifacts: 'baltimore_train.csv, baltimore_test.csv, baltimore_dev.csv'
}
}
}

7
download_dataset.sh Normal file
View File

@ -0,0 +1,7 @@
kaggle datasets download -d sohier/crime-in-baltimore
unzip crime-in-baltimore.zip
head -n 8000 BPD_Part_1_Victim_Based_Crime_Data.csv > baltimore_train.csv
tail -n 2000 BPD_Part_1_Victim_Based_Crime_Data.csv > baltimore_test.csv
head -n 2000 baltimore_train.csv > baltimore_dev.csv