modify Jenkins, add bash script ver 1

This commit is contained in:
Kamila 2022-03-27 13:25:02 +02:00
parent 9a844bf13a
commit 54ac508aa6
2 changed files with 38 additions and 1 deletions

27
Jenkinsfile vendored
View File

@ -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'
}
}
}
}
}
}

12
data_prep.sh Normal file
View File

@ -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