From 247613e9b1a6af04c3dbb67f33eefd5e1c33d9af Mon Sep 17 00:00:00 2001 From: emkarcinos Date: Mon, 21 Mar 2022 10:46:50 +0100 Subject: [PATCH] Added first pipeline steps --- Jenkinsfile | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ffd6cc0..6c4f5e4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,40 @@ pipeline { agent any + parameters { + string( + defaultValue: 'marcinkostrzewski', + 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' + ) + } + environment { + KAGGLE_USERNAME="$params.KAGGLE_USERNAME" + KAGGLE_KEY="$params.KAGGLE_KEY" + } stages { - stage('Stage 1') { + stage('Install dependencies') { steps { - echo 'Hello world!' + sh "pip install --user -r requirements.txt" + } + } + stage('Fetch and split dataset') { + steps { + script { + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { + sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' + sh 'kaggle datasets list' + } + } + sh "chmod u+x ./download_dataset.sh" + sh "./download_dataset.sh" } } } -} \ No newline at end of file +}