From a8873f1e63718276a218908818a7e143eb49c86f Mon Sep 17 00:00:00 2001 From: "sadurska@trui.pl" Date: Mon, 19 Apr 2021 14:14:54 +0200 Subject: [PATCH] tweak(UMA_03) Update Jenkinsfile and create script.sh --- Jenkinsfile | 46 ++++++++++++++++++++++------------------------ script.sh | 8 ++++++++ 2 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 script.sh diff --git a/Jenkinsfile b/Jenkinsfile index 491d1a7..c3bd96f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,25 +1,23 @@ -pipeline { - agent any - parameters { - string ( - defaultValue: 'Witaj świecie!', - description: 'Tekst, którym chcesz przywitać świat', - name: 'INPUT_TEXT', - trim: false - ) - } - stages { - stage('Hello') { - steps { - echo "INPUT_TEXT: ${INPUT_TEXT}" - sh "figlet \"${INPUT_TEXT}\" | tee output.txt" - } - } - stage('Goodbye!') { - steps { - echo 'Goodbye!' - archiveArtifacts 'output.txt' - } - } - } +pipeline{ + agent any + properties([parameters([text(defaultValue: '50', description: 'Number of lines to cutoff', name: 'CUTOFF')])]) + stages{ + stage('checkout: Check out from version control'){ + steps{ + git url: 'https://git.wmi.amu.edu.pl/s434780/ium_434780' + } + } + stage('sh: Shell Script'){ + steps{ + ./script.sh + } + } + stage('Archive artifacts'){ + steps{ + archiveArtifacts 'test.csv' + archiveArtifacts 'dev.csv' + archiveArtifacts 'train.csv' + } + } + } } \ No newline at end of file diff --git a/script.sh b/script.sh new file mode 100644 index 0000000..6575c75 --- /dev/null +++ b/script.sh @@ -0,0 +1,8 @@ +#!/bin/bash +curl -OL https://git.wmi.amu.edu.pl/s434780/ium_434780/src/branch/master/resources/Amazon_Consumer_Reviews.csv +head -n -1 Amazon_Consumer_Reviews.csv | shuf > Amazon_Consumer_Reviews.csv.shuf +wc -l Amazon_Consumer_Reviews.csv +head -n 500 Amazon_Consumer_Reviews.csv.shuf > test.csv +head -n 500 Amazon_Consumer_Reviews.csv.shuf | tail -n 2006 > dev.csv +tail -n +501 Amazon_Consumer_Reviews.csv.shuf > train.csv +wc -l *.csv \ No newline at end of file