ium_464863/Jenkinsfile

46 lines
1.2 KiB
Groovy

pipeline {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
parameters {
password (
name: 'KAGGLE_USERNAME',
defaultValue: '',
description: 'Kaggle username'
)
password (
name: 'KAGGLE_KEY',
defaultValue: '',
description: 'Kaggle API key'
)
string (
name: 'CUTOFF',
defaultValue: '500',
description: 'Get only the first CUTOFF rows of the dataset'
)
}
stages {
stage('Checkout repository') {
steps {
checkout scm
}
}
stage('Download dataset and preprocess data') {
steps {
script {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
sh "chmod +x ./download_dataset.py"
sh "python3 ./download_dataset.py ${params.CUTOFF}"
archiveArtifacts artifacts: 'datasets/*', onlyIfSuccessful: true sh "python preprocess.py --cutoff ${params.CUTOFF}"
}
}
}
}
}
}