From 66d15ac8f44619a3ae2cc67813f584562e29007c Mon Sep 17 00:00:00 2001 From: Alicja Szulecka <73056579+AliSzu@users.noreply.github.com> Date: Mon, 29 Apr 2024 21:02:47 +0200 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 44578e6..3d13b01 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,38 +11,17 @@ pipeline { checkout scm } } - stage('Download dataset') { - steps { - withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) { - sh 'pip install kaggle' - sh 'kaggle datasets download -d uciml/forest-cover-type-dataset' - sh 'unzip -o forest-cover-type-dataset.zip' - sh 'rm forest-cover-type-dataset.zip' + stage('Copy Artifacts') { + steps { + copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464914-create-dataset', selector: buildParameter('BUILD_SELECTOR') + } } - } - } - stage('Build') { - steps { - script { - withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", - "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { - def customImage = docker.build("custom-image") - customImage.inside { - sh 'python3 ./IUM_2.py' - archiveArtifacts artifacts: 'covtype.csv, forest_train.csv, forest_test.csv, forest_val.csv', onlyIfSuccessful: true - } - } - } - } - } - - stage('Train and Predict') { + stage('Train') { steps { script { def customImage = docker.build("custom-image") customImage.inside { sh 'python3 ./model.py' - sh 'python3 ./prediction.py' archiveArtifacts artifacts: 'model.pth, predictions.txt', onlyIfSuccessful: true } }