diff --git a/JenkinsfileStats b/JenkinsfileStats new file mode 100644 index 0000000..f112de9 --- /dev/null +++ b/JenkinsfileStats @@ -0,0 +1,40 @@ +pipeline { + agent any + + parameters { + string( + defaultValue: '', + description: 'Build selector for Copy artifact', + name: 'BUILD_SELECTOR' + ) + } + + stages { + stage('Checkout') { + steps { + git branch: 'main', url: 'https://git.wmi.amu.edu.pl/s495715/iumKC.git' + } + } + + stage('Copy Artifacts') { + steps { + script { + def buildSelector = params.BUILD_SELECTOR ?: 'lastSuccessful()' + copyArtifacts fingerprintArtifacts: true, projectName: 'z-s495715-create-dataset', selector: buildParameter('BUILD_SELECTOR') + } + } + } + + stage('Execute Script') { + steps { + sh './calculate_stats.sh' + } + } + + stage('Archive Results') { + steps { + archiveArtifacts artifacts: 'stats.txt', onlyIfSuccessful: true + } + } + } +} diff --git a/calculate_stats.sh b/calculate_stats.sh new file mode 100644 index 0000000..e69de29