ium_464863/Jenkinsfile
2024-04-03 21:25:30 +02:00

47 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 "echo ${params.KAGGLE_USERNAME}"
sh "chmod +x ./download_dataset.py"
sh "python3 ./download_dataset.py ${params.CUTOFF}"
archiveArtifacts artifacts: 'datasets/*', onlyIfSuccessful: true
}
}
}
}
}
}