From 659ddac84ee740272acd189a7a642ac52b9e961a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20=C5=81=C4=85czkowski?= Date: Fri, 29 Mar 2024 16:59:06 +0100 Subject: [PATCH] IUM_04 - update Jenkinsfile --- Jenkinsfile | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 96c8ea3..a125f63 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,5 @@ pipeline { - agent { - dockerfile { - filename 'Dockerfile' - args '-u root' - } - } + agent any parameters { password ( @@ -33,16 +28,27 @@ pipeline { stage('Download dataset') { steps { - withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}", "CUTOFF=${params.CUTOFF}"]) { - sh "KAGGLE_USERNAME=${params.KAGGLE_USERNAME} KAGGLE_KEY=${params.KAGGLE_KEY} kaggle datasets download -d uciml/breast-cancer-wisconsin-data" + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) { + sh "kaggle datasets download -d uciml/breast-cancer-wisconsin-data" sh "unzip -o breast-cancer-wisconsin-data.zip" sh "mkdir datasets" sh "mv data.csv datasets/data.csv" - sh "sudo chmod +x ./download_dataset.py" - sh "python3 ./download_dataset.py $CUTOFF" - archiveArtifacts artifacts: './datasets/data.csv,./datasets/train.csv,./datasets/dev.csv,./datasets/test.csv', onlyIfSuccessful: true } } } + + stage('Preprocess data') { + agent { + dockerfile { + filename 'Dockerfile' + } + } + + steps { + sh "sudo chmod +x ./download_dataset.py" + sh "python3 ./download_dataset.py ${params.CUTOFF}" + archiveArtifacts artifacts: './datasets/data.csv,./datasets/train.csv,./datasets/dev.csv,./datasets/test.csv', onlyIfSuccessful: true + } + } } } \ No newline at end of file