Update Jenkinsfile-stats

This commit is contained in:
s464962 2024-03-26 23:30:06 +01:00
parent e5d94a4a06
commit f4c10a9026

View File

@ -1,51 +1,52 @@
pipeline { pipeline {
agent any agent any
parameters { parameters {
buildSelector( choice(
defaultSelector: lastSuccessful(), choices: ['lastSuccessful()', 'lastStable()', 'specificBuild()', 'savedBuilds()', 'upstreamBuild()', 'downstreamBuild()'],
description: 'Which build to use for copying artifacts', defaultValue: 'lastSuccessful()',
name: 'BUILD_SELECTOR' description: 'Which build to use for copying artifacts',
) name: 'BUILD_SELECTOR'
string( )
defaultValue: '1000', string(
description: 'CUTOFF', defaultValue: '1000',
name: 'CUTOFF', description: 'CUTOFF',
trim: false name: 'CUTOFF',
) trim: false
} )
}
stages {
stage('Copy artifacts') { stages {
steps { stage('Copy artifacts') {
script { steps {
copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464962-create-dataset', selector: buildParameter('BUILD_SELECTOR') script {
} copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464962-create-dataset', selector: buildParameter('BUILD_SELECTOR')
} }
post { }
success { post {
echo 'Artifacts copied successfully.' success {
} echo 'Artifacts copied successfully.'
} }
} }
stage('Set execute permission') { }
steps { stage('Set execute permission') {
script { steps {
sh 'chmod +x dataset-stats.sh' script {
} sh 'chmod +x dataset-stats.sh'
} }
} }
stage('Run shell script') { }
steps { stage('Run shell script') {
script { steps {
sh './dataset-stats.sh' script {
} sh './dataset-stats.sh'
} }
post { }
success { post {
archiveArtifacts artifacts: 'stats.txt', allowEmptyArchive: true success {
} archiveArtifacts artifacts: 'stats.txt', allowEmptyArchive: true
} }
} }
} }
} }
}