diff --git a/Jenkinsfile b/Jenkinsfile index 084af52..50b74c1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,34 +1,22 @@ node { - // stage('Preparation') { - // properties ([ - // parameters([ - // string( - // defaultValue:'mateuszogrodowczyk', - // description: 'Kaggle username', - // name: 'KAGGLE_USERNAME', - // trim: false - // ), - // password( - // description: 'Kaggle access token retrieved from kaggle.json file - https://github.com/Kaggle/kaggle-api#api-credentials', - // name: 'KAGGLE_KEY' - // ) - // ]) - // ]) - // } - + stage('checkout: Check out from version control') { + git 'https://git.wmi.amu.edu.pl/s478841/ium_478841.git' + } stage('Install depends.') { sh 'pip install --user -r requirements.txt' } - stage('Prepare dataset') { + stage('sh: Shell script') { withEnv([ "KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { - sh 'echo Welcome: $KAGGLE_USERNAME' - sh 'kaggle datasets list' + sh 'chmod u+x ./load_data.sh' + sh './load_data.sh' + } + } + post { + always { + archiveArtifacts artifacts: 'avocado.data*', onlyIfSuccessful: true } - - sh 'chmod u+x ./load_data.sh' - sh './load_data.sh' } } diff --git a/load_data.sh b/load_data.sh index ea938b9..dfeaf85 100644 --- a/load_data.sh +++ b/load_data.sh @@ -1 +1,13 @@ -figlet "Load data" \ No newline at end of file +figlet "Welcome $KAGGLE_USERNAME" + +rm -r avocado.data* + +kaggle datasets download -d neuromusic/avocado-prices +unzip -o avocado-prices.zip + +tail -n +2 avocado.csv | shuf > avocado_shuf.csv +head -n 14000 avocado_shuf.csv > avocado.data.train +tail -n +14001 avocado_shuf.csv | head -n 2249 > avocado.data.valid +tail -n 2000 avocado_shuf.csv > avocado.data.test + +wc -l avocado.data* > results.txt \ No newline at end of file