48 lines
1.3 KiB
Groovy
48 lines
1.3 KiB
Groovy
pipeline {
|
|
agent {
|
|
dockerfile {
|
|
filename 'Dockerfile'
|
|
reuseNode true
|
|
args '-e KAGGLE_USERNAME=${KAGGLE_USERNAME} -e KAGGLE_KEY=${KAGGLE_KEY}'
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |