ium_464863/Jenkinsfile

47 lines
1.3 KiB
Groovy

pipeline {
agent any
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('Build Docker image') {
steps {
script {
docker.build("create-dataset-s464863")
}
}
}
stage('Download dataset and preprocess data') {
steps {
docker.image('create-dataset-s464863').withRun("-e KAGGLE_USERNAME=${params.KAGGLE_USERNAME} -e KAGGLE_KEY=${params.KAGGLE_KEY} -e CUTOFF=${params.CUTOFF}") {
sh "chmod +x ./download_dataset.py"
sh "python3 ./download_dataset.py ${params.CUTOFF}"
archiveArtifacts artifacts: 'datasets/*', onlyIfSuccessful: true
}
}
}
}
}