Add new jenkinsfile for dataset stats

This commit is contained in:
AdamOsiowy123 2022-03-27 21:34:16 +02:00
parent 40f77b27d6
commit f9e12e8e3c
3 changed files with 29 additions and 1 deletions

26
Jenkinsfile2 Normal file
View File

@ -0,0 +1,26 @@
node {
stage('Preparation') {
properties([parameters([
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR')
])])
}
stage('Clone repository') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: '5e0a58a0-03ad-41dd-beff-7b8a07c7fe0c', url: 'https://git.wmi.amu.edu.pl/s444452/ium_444452.git']]])
}
stage('Copy artifacts') {
copyArtifacts filter: 'dataset.csv', fingerprintArtifacts: true, projectName: 's444452-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
stage('Run script') {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
sh "chmod u+x ./dataset_stats.sh"
sh "./dataset_stats.sh"
}
}
stage('Archive artifacts') {
archiveArtifacts 'stats.txt'
}
}

3
dataset_stats.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
wc -l dataset.csv > stats.txt

View File

@ -1,5 +1,4 @@
#!/bin/bash
kaggle datasets download -d shivamb/real-or-fake-fake-jobposting-prediction
ls
unzip -oc real-or-fake-fake-jobposting-prediction.zip | shuf | head -n $1 > dataset.csv