tweak(UMA_03) Update Jenkinsfile and create script.sh

This commit is contained in:
sadurska@trui.pl 2021-04-19 14:14:54 +02:00
parent 5484926efc
commit a8873f1e63
2 changed files with 30 additions and 24 deletions

26
Jenkinsfile vendored
View File

@ -1,24 +1,22 @@
pipeline{ pipeline{
agent any agent any
parameters { properties([parameters([text(defaultValue: '50', description: 'Number of lines to cutoff', name: 'CUTOFF')])])
string (
defaultValue: 'Witaj świecie!',
description: 'Tekst, którym chcesz przywitać świat',
name: 'INPUT_TEXT',
trim: false
)
}
stages{ stages{
stage('Hello') { stage('checkout: Check out from version control'){
steps{ steps{
echo "INPUT_TEXT: ${INPUT_TEXT}" git url: 'https://git.wmi.amu.edu.pl/s434780/ium_434780'
sh "figlet \"${INPUT_TEXT}\" | tee output.txt"
} }
} }
stage('Goodbye!') { stage('sh: Shell Script'){
steps{ steps{
echo 'Goodbye!' ./script.sh
archiveArtifacts 'output.txt' }
}
stage('Archive artifacts'){
steps{
archiveArtifacts 'test.csv'
archiveArtifacts 'dev.csv'
archiveArtifacts 'train.csv'
} }
} }
} }

8
script.sh Normal file
View File

@ -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