Jenkinsfile + script fixes

This commit is contained in:
Andrzej Preibisz 2022-03-27 13:28:05 +02:00
parent 84eea01ea3
commit 76e3ced286
2 changed files with 19 additions and 9 deletions

14
Jenkinsfile vendored
View File

@ -7,19 +7,21 @@ node {
description: 'Tekst do wyświetlenie', description: 'Tekst do wyświetlenie',
name: 'INPUT_TEXT', name: 'INPUT_TEXT',
trim: false trim: false
),
string(
defaultValue: "10000",
description: "How many records use",
name: "CUTOFF"
) )
]) ])
]) ])
} }
stage('Hello') { stage('Download') {
//Wypisz wartość parametru w konsoli (To nie jest polecenie bash, tylko groovy!) sh "dataset_script.sh \"${CUTOFF}\""
echo "INPUT_TEXT: ${INPUT_TEXT}"
//Wywołaj w konsoli komendę "figlet", która generuje ASCI-art
sh "figlet \"${INPUT_TEXT}\" | tee output.txt"
} }
stage('Goodbye') { stage('Goodbye') {
echo 'Goodbye!' echo 'Goodbye!'
//Zarchiwizuj wynik //Zarchiwizuj wynik
archiveArtifacts 'output.txt' archiveArtifacts 'heart_2020_test.csv, heart_2020_train.csv, heart_2020_sorted.csv'
} }
} }

View File

@ -1,3 +1,11 @@
#!/bin/bash
CUTOFF=$1
TEST_SIZE=$(($CUTOFF * 1/5))
TRAIN_START=$(($TEST_SIZE+1))
echo $TEST_SIZE
echo $TRAIN_START
! kaggle datasets download kamilpytlak/personal-key-indicators-of-heart-disease ! kaggle datasets download kamilpytlak/personal-key-indicators-of-heart-disease
! unzip personal-key-indicators-of-heart-disease -d ./ ! unzip personal-key-indicators-of-heart-disease -d ./
! wc -l heart_2020_cleaned.csv ! wc -l heart_2020_cleaned.csv
@ -9,10 +17,10 @@ echo "Categories: \n"
! grep -P "^$" -n heart_2020_cleaned.csv ! grep -P "^$" -n heart_2020_cleaned.csv
! head -n -1 heart_2020_cleaned.csv | shuf > heart_2020_sorted.csv ! head -n $CUTOFF heart_2020_cleaned.csv | shuf > heart_2020_sorted.csv
! head -n 4000 heart_2020_sorted.csv > heart_2020_test.csv ! head -n $TEST_SIZE heart_2020_sorted.csv > heart_2020_test.csv
! tail -n +4001 heart_2020_sorted.csv > heart_2020_train.csv ! tail -n +$TRAIN_START heart_2020_sorted.csv > heart_2020_train.csv
! wc -l heart_2020_t* ! wc -l heart_2020_t*