From 76569ee0d5a78102e456700143bc4a987d9aa8de Mon Sep 17 00:00:00 2001 From: s434732 Date: Sun, 28 Mar 2021 19:27:38 +0200 Subject: [PATCH] done --- Jenkinsfile | 43 +++++++++++++++++++++++++++++++++++++++++++ skrypt_zad2.sh | 13 +++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 Jenkinsfile create mode 100644 skrypt_zad2.sh diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..437e013 --- /dev/null +++ b/Jenkinsfile @@ -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" + } + } + } + } +} diff --git a/skrypt_zad2.sh b/skrypt_zad2.sh new file mode 100644 index 0000000..d0bafa2 --- /dev/null +++ b/skrypt_zad2.sh @@ -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* \ No newline at end of file