From 769c2d731fbc691ed4fae9be5eacefedbe4e213c Mon Sep 17 00:00:00 2001 From: Adrian Charkiewicz Date: Thu, 24 Mar 2022 21:12:58 +0100 Subject: [PATCH] Jenkisfile2 --- Jenkinsfile | 2 -- Jenkinsfile2 | 60 ++++++++++++++++++++++------------------------------ script2.sh | 4 ++++ 3 files changed, 29 insertions(+), 37 deletions(-) create mode 100644 script2.sh diff --git a/Jenkinsfile b/Jenkinsfile index a1de0cf..f13b333 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,8 +35,6 @@ pipeline { archiveArtifacts 'TEST_winequality-red.csv' archiveArtifacts 'TRAIN_winequality-red.csv' archiveArtifacts 'VAL_winequality-red.csv' - - } } } diff --git a/Jenkinsfile2 b/Jenkinsfile2 index 4b87629..047a791 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -1,37 +1,27 @@ pipeline { - agent any - parameters { - string( - defaultValue: 'sknera', - description: 'username', - name: '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' - ) - string( - defaultValue: '20', - description: 'Value for head command', - name: 'CUTOFF' - ) - } - environment { - KAGGLE_USERNAME="$params.KAGGLE_USERNAME" - KAGGLE_KEY="$params.KAGGLE_KEY" - CUTOFF="$params.CUTOFF" - } - stages { - stage('Stage 1') { - steps { - echo 'Hello world' - checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s444354/ium_444354']]]) - sh "chmod u+x ./dataset_download.sh" - sh "KAGGLE_USERNAME=${KAGGLE_USERNAME} KAGGLE_KEY=${KAGGLE_KEY} CUTOFF=${CUTOFF} ./download.sh" - archiveArtifacts 'data.txt' - } - } - } + agent any + parameters{ + buildSelector( + defaultSelector: lastSuccessful(), + name: 's444354-create-dataset', + description: 'Which build to use for copying artifacts' + ) + + } + + stages { + stage("Check out from version control") { + steps { + checkout scm + } + } + stage("Shell Script") { + steps { + sh "chmod u+x ./script2.sh" + sh " ./script2.sh" + archiveArtifacts 'num_of_lines.txt' + + } + } + } } \ No newline at end of file diff --git a/script2.sh b/script2.sh new file mode 100644 index 0000000..86c300d --- /dev/null +++ b/script2.sh @@ -0,0 +1,4 @@ +#!/bin/sh + + +wc -l > num_of_lines.txt \ No newline at end of file