diff --git a/Jenkinsfile b/Jenkinsfile index ffd6cc0..e1f0c4c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,35 @@ pipeline { agent any + parameters { + string( + defaultValue: 'kamilab0bkowska', + description: '', + name: 'KAGGLE_USERNAME', + trim: false + ), + password( + defaultValue: '', + description: '', + name: 'KAGGLE_KEY' + ) + + } stages { stage('Stage 1') { steps { echo 'Hello world!' } } + stage('Get data save artifacts') { + steps { + withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", + "KAGGLE_KEY=${params.KAGGLE_KEY}" ]) { + sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME' + sh 'data_prep.sh' + archiveArtifacts artifacts: 'apps_train.csv, apps_test.csv, apps_validate.csv' + } + } + } } -} \ No newline at end of file +} + diff --git a/data_prep.sh b/data_prep.sh new file mode 100644 index 0000000..d8ace10 --- /dev/null +++ b/data_prep.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +kaggle datasets download -d lava18/google-play-store-apps +unzip -o google-play-store-apps.zip +sed -i '1d' googleplaystore.csv +shuf googleplaystore.csv > apps_shuf.csv +#cp apps_shuf.csv apps_shuf_copy.csv +head -n 6505 apps_shuf.csv > apps_train.csv +sed -i '1,6505d' apps_shuf.csv +head -n 2168 apps_shuf.csv > apps_test.csv +sed -i '1,2168d' apps_shuf.csv +head -n 2168 apps_shuf.csv > apps_validate.csv \ No newline at end of file