diff --git a/Jenkinsfile2.txt b/Jenkinsfile2.txt new file mode 100644 index 0000000..1a6ee39 --- /dev/null +++ b/Jenkinsfile2.txt @@ -0,0 +1,31 @@ +node { + stage('Preparation') { + properties([ + parameters([ + string( + defaultValue: 'tomaszzitkiewicz', + description: 'Kaggle username', + name: 'KAGGLE_USERNAME', + trim: false + ), + password( + defaultValue: '', + description: 'Kaggle token taken from kaggle.json file, as described in https://github.com/Kaggle/kaggle-api#api-credentials', + name: 'KAGGLE_KEY' + ) + ]) + ]) + } + +stage('Git clone') { + checkout([$class: 'GitSCM', branches: [[name: '*/master']], + userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s407409/ium_407409.git']]]) + } + + stage('Bash') { + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { + sh 'download_data' + } + } +} \ No newline at end of file diff --git a/download_data.sh b/download_data.sh new file mode 100644 index 0000000..84b8812 --- /dev/null +++ b/download_data.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +kaggle datasets download -d brezniczky/2019-european-parliament-election-in-poland-data +unzip -o 2019-european-parliament-election-in-poland-data.zip +shuf wyniki_gl_na_kand_po_obwodach_sheet_1.csv > data_shuf +head -n 100 vgsales_shuf > data.test +head -n 201 vgsales_shuf | tail -n 100 > data.val +head -n 1000 vgsales_shuf | tail -n 800 > data.train