IUM_s464980/Jenkinsfile
2024-05-14 21:56:39 +02:00

60 lines
1.6 KiB
Groovy

pipeline {
agent any
parameters {
string (
name: 'KAGGLE_USERNAME',
defaultValue: 'ardenw',
description: 'Kaggle username'
)
password (
name: 'API_KEY',
defaultValue: '',
description: 'Kaggle API key'
)
string (
name: 'DATA_TRAIN_RATIO',
defaultValue: '80',
description: 'Train data ratio percentage'
)
string (
name: 'CUTOFF',
defaultValue: '500',
description: 'Cutoff value'
)
}
stages {
stage('Checkout repository') {
steps {
checkout scm
}
}
stage('Download dataset') {
steps {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.API_KEY}"]) {
sh "kaggle datasets download -d nikhil7280/student-performance-multiple-linear-regression --unzip"
}
}
}
stage('Prepare dataset') {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
steps {
sh "chmod +x ./get_dataset.py"
sh "python ./get_dataset.py"
archiveArtifacts artifacts: 'dataset.csv,df_train.csv,df_test.csv', onlyIfSuccessful: true
}
}
stage('Run training'){
steps{
script {
build(job: 's464980-training/master')
}
}
}
}