Dodanie skryptu + konfiguracji Jenkins - zadanie 5,6,7

This commit is contained in:
Wojciech Jarmosz 2021-03-27 22:37:36 +01:00
parent 6922accdbc
commit 278daac14c
2 changed files with 24 additions and 4 deletions

14
Jenkinsfile vendored
View File

@ -1,9 +1,17 @@
pipeline {
agent any
stages {
stage('Stage 1') {
steps {
echo 'Hello world!'
node {
stage('Clone repo + run bash script') {
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: [[credentialsId: 'f746c8e0-e974-4758-838d-1920a7b0e3dc', url: 'https://git.wmi.amu.edu.pl/s434704/ium_434704']]])
sh "chmod 777 ./data_sets.sh"
sh "./data_sets.sh"
archiveArtifacts "MoviesOnStreamingPlatforms_updated.dev"
archiveArtifacts "MoviesOnStreamingPlatforms_updated.test"
archiveArtifacts "MoviesOnStreamingPlatforms_updated.train"
}
}
}
}

12
data_stats.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
pip install kaggle
kaggle datasets download ruchi798/movies-on-netflix-prime-video-hulu-and-disney --unzip
sed -i '/^$/d' ./MoviesOnStreamingPlatforms_updated.csv
shuf ./MoviesOnStreamingPlatforms_updated.csv | tail -n +"${CUTOFF}" > ./MoviesOnStreamingPlatforms_updated.shuf
head -n 1674 ./MoviesOnStreamingPlatforms_updated.shuf > ./MoviesOnStreamingPlatforms_updated.test
head -n 3348 ./MoviesOnStreamingPlatforms_updated.shuf | tail -n 1674 > ./MoviesOnStreamingPlatforms_updated.dev
tail -n +3349 ./MoviesOnStreamingPlatforms_updated.shuf > ./MoviesOnStreamingPlatforms_updated.train
rm ./MoviesOnStreamingPlatforms_updated.shuf
rm ./MoviesOnStreamingPlatforms_updated.csv
wc -l ./MoviesOnStreamingPlatforms_updated*