ium_464913/Jenkinsfile
2024-04-01 14:46:44 +02:00

45 lines
1.1 KiB
Groovy

pipeline {
agent {
dockerfile true
}
parameters {
string (
defaultValue: 'vskyper',
description: 'Kaggle username',
name: 'KAGGLE_USERNAME',
trim: false
)
password (
defaultValue: '',
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
name: 'KAGGLE_KEY',
)
}
stages {
stage('env') {
steps {
sh 'id'
sh 'whoami'
sh 'pwd'
}
}
stage('Run create-dataset script') {
steps {
withEnv (["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
sh 'mkdir /.kaggle'
sh 'echo "{\"username\":\"$KAGGLE_USERNAME\",\"key\":\"$KAGGLE_KEY\"}" > /.kaggle/kaggle.json'
sh 'chmod 600 /.kaggle/kaggle.json'
sh 'chmod +x create-dataset.py'
sh 'python3 ./create-dataset.py'
}
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts artifacts: '/data/*', onlyIfSuccessful: true
}
}
}
}