diff --git a/Jenkinsfile b/Jenkinsfile index b056a11..fbd63c3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,18 @@ pipeline { agent any + parameters { + string ( + defaultValue: 'wirus006', + description: 'Kaggle username', + name: 'KAGGLE_USERNAME', + trim: false + ) + password ( + defaultValue: 'c3323e37d3f91a0914d0172ef3c7c30c', + description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials', + name: 'KAGGLE_KEY' + ) + } stages { stage('Hello') { steps { @@ -13,8 +26,11 @@ pipeline { } stage('Shell Script') { steps { - sh "chmod +x -R ${env.WORKSPACE}" - sh './simple_init.sh' + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}"]) { + sh "chmod +x -R ${env.WORKSPACE}" + sh './simple_init.sh' + } } } } diff --git a/simple_init.sh b/simple_init.sh index 36f0670..230a930 100644 --- a/simple_init.sh +++ b/simple_init.sh @@ -1 +1,2 @@ echo 'test' +kaggle datasets download -d hakeem/atp-and-wta-tennis-data