ium_464863/Jenkinsfile
2024-04-03 23:21:56 +02:00

53 lines
1.4 KiB
Groovy

pipeline {
agent {
dockerfile {
filename 'Dockerfile'
reuseNode true
}
}
environment {
KAGGLE_USERNAME = credentials('KAGGLE_USERNAME')
KAGGLE_KEY = credentials('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('Clone repository') {
steps {
checkout scm
}
}
stage('Download dataset and preprocess data') {
steps {
script {
sh "echo ${env.KAGGLE_USERNAME}"
sh "echo ${KAGGLE_USERNAME}"
sh "echo ${CUTOFF}"
sh "echo ${params.CUTOFF}"
sh "chmod +x ./download_dataset.py"
sh "python3 ./download_dataset.py ${params.CUTOFF}"
archiveArtifacts artifacts: 'datasets/*', onlyIfSuccessful: true
}
}
}
}
}