ium_464863/Jenkinsfile
2024-03-29 15:59:59 +01:00

46 lines
1.4 KiB
Groovy

pipeline {
agent {
dockerfile 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('Clone repository') {
steps {
checkout scm
}
}
stage('Download dataset') {
steps {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}", "CUTOFF=${params.CUTOFF}"]) {
sh "sudo mkdir /.kaggle"
sh "sudo echo > /.kaggle/kaggle.json"
sh "sudo chmod 777 /.kaggle/kaggle.json"
sh "sudo chown `whoami` /.kaggle/kaggle.json"
sh "sudo export KAGGLE_CONFIG_DIR=/.kaggle"
sh "sudo chmod +x ./download_dataset.py"
sh "python3 ./download_dataset.py $CUTOFF"
archiveArtifacts artifacts: './datasets/data.csv,./datasets/train.csv,./datasets/dev.csv,./datasets/test.csv', onlyIfSuccessful: true
}
}
}
}
}