add second Jenkinsfile and shell script

This commit is contained in:
piotrwrzodak 2023-04-20 23:58:00 +02:00
parent b2fc125f1c
commit 4d16ca6bcc
3 changed files with 35 additions and 1 deletions

2
Jenkinsfile vendored
View File

@ -31,7 +31,7 @@ pipeline {
sh 'ls -a'
sh 'chmod +x create-dataset.sh'
sh './create-dataset.sh'
archiveArtifacts 'data/barcelona_weekends.train.csv, data/barcelona_weekends.dev.csv, data/barcelona_weekends.test.csv'
archiveArtifacts artifacts: 'data/barcelona_weekends.train.csv, data/barcelona_weekends.dev.csv, data/barcelona_weekends.test.csv', fingerprint: true
}
}
}

29
Jenkinsfile-dataset-stats Normal file
View File

@ -0,0 +1,29 @@
pipeline {
agent any
parameters([
buildSelector(
defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts',
name: 'BUILD_SELECTOR'
)
])
stages {
stage('Copy Artifacts') {
steps {
copyArtifacts fingerprintArtifacts: true, projectName: 'z-s444510-create-dataset', selector: buildParameter('BUILD_SELECTOR')
}
}
stage('Calculate Dataset Statistics') {
steps {
sh 'chmod +x dataset-stats.sh'
sh './dataset-stats.sh'
}
post {
always {
archiveArtifacts artifacts: 'stats.txt.gz', fingerprint: true
}
}
}
}
}

5
dataset-stats.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
zcat barcelona_weekends.dev.csv | wc -l > stats
gzip -c stats > stats.txt.gz