pipeline { agent { dockerfile { filename 'Dockerfile' args '-u root -v $HOME:/app' } } 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('Run create-dataset script') { steps { withEnv (["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) { dir ('/app') { sh 'chmod +x create-dataset.py' sh 'python3 ./create-dataset.py' } } } } stage('Archive Artifacts') { steps { archiveArtifacts artifacts: '/app/data/*', onlyIfSuccessful: true } } } }