Update Jenkinsfiles, bash scripts ver 1.7

This commit is contained in:
Kamila 2022-03-27 19:15:04 +02:00
parent acdb4cb429
commit 70f3a128f5
3 changed files with 49 additions and 5 deletions

44
Jenkinsfile_2 Normal file
View File

@ -0,0 +1,44 @@
pipeline {
agent any
parameters {
string(
defaultValue: 'kamilab0bkowska',
description: 'kaggle username',
name: 'KAGGLE_USERNAME',
trim: false
)
password(
defaultValue: '',
description: 'kaggle passowrd',
name: 'KAGGLE_KEY'
)
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
}
stages {
stage('Stage 1') {
steps {
echo 'Hello world but for the second time!'
}
}
stage('Copy and proceed') {
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 's444517-create-dataset', selector: buildParameter('BUILD_SELECTOR')
sh 'chmod +x -R ./data_stats.sh'
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
sh 'echo KAGGLE_USERNAME: $KAGGLE_USERNAME'
sh './data_stats.sh'
archiveArtifacts artifacts: 'apps_train.csv, apps_test.csv, apps_validate.csv'
}
}
}
}
}

View File

@ -1,6 +1,6 @@
#!/bin/bash
#kaggle datasets download -d lava18/google-play-store-apps
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
@ -18,7 +18,4 @@ sed -i "$lines"'d' apps_shuf.csv
head -n $train_val_set apps_shuf.csv > apps_test.csv
lines="1,$train_val_set"
sed -i "$lines"'d' apps_shuf.csv
head -n $train_val_set apps_shuf.csv > apps_validate.csv
wc -l apps_train.csv
wc -l apps_test.csv
wc -l apps_validate.csv
head -n $train_val_set apps_shuf.csv > apps_validate.csv

3
data_stats.sh Normal file
View File

@ -0,0 +1,3 @@
wc -l apps_train.csv > stats.txt
wc -l apps_test.csv >> stats.txt
wc -l apps_validate.csv >> stats.txt