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

46
Jenkinsfile vendored
View File

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

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