Zad 03.Jenkins - zapisanie zbioru danych

This commit is contained in:
Cezary Gałązkiewicz 2022-03-28 00:52:40 +02:00
parent a008e63b34
commit fe61b195fa
2 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,7 @@
kaggle datasets download -d csafrit2/steel-industry-energy-consumption --force kaggle datasets download -d csafrit2/steel-industry-energy-consumption --force
unzip -o steel-industry-energy-consumption.zip unzip -o steel-industry-energy-consumption.zip
tail -n +2 Steel_industry_data.csv | cut -d, -f8 --complement | shuf > steel_industry_data_shuffled.csv head -n $CUTOFF Steel_industry_data.csv | tail -n +2 | cut -d, -f8 --complement | shuf > steel_industry_data_shuffled.csv
number_of_lines=$(wc -l steel_industry_data_shuffled.csv | awk '{print $1}') number_of_lines=$(wc -l steel_industry_data_shuffled.csv | awk '{print $1}')
test_len=$((number_of_lines/10)) test_len=$((number_of_lines/10))
dev_len=$((number_of_lines/10)) dev_len=$((number_of_lines/10))

View File

@ -12,6 +12,10 @@ pipeline {
description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials', description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials',
name: 'KAGGLE_KEY' name: 'KAGGLE_KEY'
) )
string(
defaultValue: '35041',
description: 'CUTOFF parameter',
name: 'CUTOFF')
} }
environment { environment {
KAGGLE_USERNAME="$params.KAGGLE_USERNAME" KAGGLE_USERNAME="$params.KAGGLE_USERNAME"
@ -32,7 +36,8 @@ pipeline {
steps { steps {
sh 'chmod u+x ./download.sh' sh 'chmod u+x ./download.sh'
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}"]) { "KAGGLE_KEY=${params.KAGGLE_KEY}",
"CUTOFF=${params.CUTOFF}"]) {
sh "echo KAGGLE_USERNAME: $KAGGLE_USERNAME" sh "echo KAGGLE_USERNAME: $KAGGLE_USERNAME"
sh "./download.sh" sh "./download.sh"
archiveArtifacts artifacts: "steel_industry_data_test.csv, steel_industry_data_dev.csv, steel_industry_data_train.csv" archiveArtifacts artifacts: "steel_industry_data_test.csv, steel_industry_data_dev.csv, steel_industry_data_train.csv"