32 lines
849 B
Groovy
32 lines
849 B
Groovy
pipeline {
|
|
agent {
|
|
dockerfile true
|
|
}
|
|
parameters {
|
|
string (
|
|
defaultValue: 'my_username',
|
|
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/blob/main/docs/README.md#api-credentials',
|
|
name: 'KAGGLE_KEY'
|
|
)
|
|
}
|
|
volumes {
|
|
hostPath("${HOME}/.kaggle") # Replace with your desired host path
|
|
containerPath("/app/.kaggle")
|
|
}
|
|
stages {
|
|
stage('Kaggle') {
|
|
steps {
|
|
script {
|
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
|
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
|
|
sh 'kaggle datasets list'
|
|
}
|
|
}
|
|
}
|
|
} |