This commit is contained in:
s434732 2021-03-28 19:27:38 +02:00
parent 6793833ece
commit 76569ee0d5
2 changed files with 56 additions and 0 deletions

43
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,43 @@
pipeline {
agent any
stages {
stage('One') {
properties([
parameters([
string(defaultValue: '',
description: 'Kaggle username',
name: 'KAGGLE_USERNAME',
trim: false),
password(defaultValue: '',
description: 'Kaggle token',
name: 'KAGGLE_KEY'),
string(defaultValue: '5000',
description: 'Data cutoff',
name: 'CUTOFF',
trim: false)
])
]
)
stage('Two') {
steps {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}", "CUTOFF=${params.CUTOFF}" ]) {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s434732/ium_434732']]])
sh "chmod 777 ./skrypt_zad2.sh"
sh "./skrypt_zad2.sh"
archiveArtifacts "results.csv_cut.dev"
archiveArtifacts "results.csv_cut.test"
archiveArtifacts "results.csv_cut.train"
}
}
}
}
}

13
skrypt_zad2.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
pip install kaggle
kaggle datasets download martj42/international-football-results-from-1872-to-2017 --unzip
shuf ./results.csv.csv | tail -n +"${CUTOFF}" > ./results.csv_cut.shuf
head -n 75384 ./results.csv_cut.shuf > ./results.csv_cut.test
head -n 150768 ./results.csv_cut.shuf | tail -n 75384 > ./results.csv_cut.dev
tail -n +150769 ./results.csv_cut.shuf > ./results.csv_cut.train
rm ./results.csv_cut.shuf
rm ./results.csv_cut.csv
wc -l ./results.csv_cut*