From f8f5eab816cab255e4d48cb6e206f912a71489a5 Mon Sep 17 00:00:00 2001 From: Maciej Czajka Date: Fri, 25 Mar 2022 20:40:44 +0100 Subject: [PATCH] fix jenkinsfile and add download.sh --- Jenkinsfile | 32 ++++++++++++++++++++++++++++++++ download.sh | 12 ++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 download.sh diff --git a/Jenkinsfile b/Jenkinsfile index 7e78227..61d545a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,5 +31,37 @@ pipeline { checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 's444356', url: 'https://git.wmi.amu.edu.pl/s444356/ium_444356.git']]]) } } + + stage('Script'){ + steps { + sh './download.sh' + } + } + + stage('Preparation') { + properties([ + parameters([ + string( + defaultValue: 'maciejczajka', + 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('Build') { + // Run the maven build + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { + sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' + sh 'kaggle datasets list' + } + } } } \ No newline at end of file diff --git a/download.sh b/download.sh new file mode 100755 index 0000000..a63e1ff --- /dev/null +++ b/download.sh @@ -0,0 +1,12 @@ +dataset_operation() { + cat all_games.csv | gshuf > all_games.csv.shuf + head -n 1880 all_games.csv.shuf > all_games.csv.test + head -n 3760 all_games.csv.shuf | tail -n 1880 > all_games.csv.dev + tail -n +3761 all_games.csv.shuf > all_games.csv.train + rm all_games.csv.shuf + wc -l all_games.csv.* +} + +kaggle datasets download -d deepcontractor/top-video-games-19952021-metacritic +unzip top-video-games-19952021-metacritic.zip +dataset_operation \ No newline at end of file