From d84958dfa4d62657036edae0cffe79efed469d56 Mon Sep 17 00:00:00 2001 From: Kornelia Girejko Date: Sun, 27 Mar 2022 20:56:24 +0200 Subject: [PATCH] Zaktualizuj 'Jenkinsfile' --- Jenkinsfile | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8b2c8ca..69f2907 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,41 @@ pipeline { agent any + parameters { + string( + defaultValue: 'kgirejko', + description: 'Kaggle username', + name: 'KAGGLE_USERNAME', + trim: false + ) + + password( + defaultValue: '51854c15661583860a60db232a7026f0', + description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials', + name: 'KAGGLE_KEY' + ) + + string( + defaultValue: '', + description: 'Value for head command', + name: 'CUTOFF' + ) + } + + environment { + KAGGLE_USERNAME="$params.KAGGLE_USERNAME" + KAGGLE_KEY="$params.KAGGLE_KEY" + CUTOFF="$params.CUTOFF" + } + stages { - stage('Hello') { + stage('First') { steps { - echo 'Hello World' + checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://git.wmi. amu.edu.pl/s478815/ium_478815.git']]]) + sh "chmod a+x ./skrypt.sh" + sh "KAGGLE_USERNAME=${KAGGLE_USERNAME} KAGGLE_KEY=${KAGGLE_KEY} CUTOFF=${CUTOFF} ./skrypt.sh" + archiveArtifacts 'data.csv', + } } }