From 139ef69ca87be999448b453c0fbb82f8b6ba47e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Zar=C4=99ba?= Date: Wed, 10 May 2023 16:07:56 +0200 Subject: [PATCH] asd --- Jenkinsfile | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d227dbe..8e041ff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,41 +40,45 @@ pipeline { } } stage('Build') { + //when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } } + steps { + script { + try { + //withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + // "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { + //sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' + sh ''' + #!/bin/bash + pip install kaggle + + git clone https://git.wmi.amu.edu.pl/s487187/ium_487187.git + + echo "Processed Data" > output.txt + ''' + sh "head -n ${params.CUTOFF} data.csv" + } + } catch (err) { + error "Failed to build: ${err.message}" + } + + } + } + + stage('Clone Git Repository') { when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } } steps { script { try { - // withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", - // "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { - // sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' - // sh ''' - // #!/bin/bash - // pip install kaggle - - // git clone https://git.wmi.amu.edu.pl/s487187/ium_487187.git - - // echo "Processed Data" > output.txt - // ''' - // sh "head -n ${params.CUTOFF} data.csv" - // } - sh ''' - #!/bin/bash - pip install kaggle - - git clone https://git.wmi.amu.edu.pl/s487187/ium_487187.git - - echo "Processed Data" > output.txt - ''' - sh "head -n ${params.CUTOFF} data.csv" + git 'https://git.wmi.amu.edu.pl/s487187/ium_487187.git' } catch (err) { - error "Failed to build: ${err.message}" + error "Failed to clone repository: ${err.message}" } } } } stage('End') { - // when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } } + when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } } steps { echo 'Program ended!' }