ium_464962/Jenkinsfile
Krzysztof Raczyński 234be6c972 fix predict.py
2024-05-13 21:25:38 +02:00

53 lines
1.5 KiB
Groovy

pipeline {
agent {
dockerfile true
}
parameters {
string(
defaultValue: '10000',
name: 'CUTOFF',
description: 'Liczba wierszy do obcięcia ze zbioru danych')
string(
defaultValue: '',
name: 'KAGGLE_USERNAME',
description: 'Kaggle username')
password(
defaultValue: '',
name: 'KAGGLE_KEY',
description: 'Kaggle API key')
}
stages {
stage('Clone Repository') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/main']], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s464962/ium_464962']]])
}
}
stage('Download') {
steps {
withEnv([
"KAGGLE_USERNAME=${env.KAGGLE_USERNAME}",
"KAGGLE_KEY=${env.KAGGLE_KEY}"
]) {
sh "bash ./create-dataset.sh ${params.CUTOFF}"
}
}
}
stage('Train and predict') {
steps {
sh "chmod +x ./model.py"
sh "chmod +x ./predict.py"
sh "python ./model.py"
sh "python ./predict.py"
archiveArtifacts artifacts: 'car_prices_predict_model.h5, predicted_selling_prices.csv', onlyIfSuccessful: true
}
}
stage('Archive Results') {
steps {
archiveArtifacts artifacts: 'data/*', onlyIfSuccessful: true
}
}
}
}