pipeline { agent { dockerfile true } environment{ WER_EXISTS = fileExists 'last-results/wer.txt' SRR_EXISTS = fileExists 'last-results/srr.txt' } stages { //Niepotrzebne jezeli Jenkinsfile jest pobierany z repo. stage('Checkout') { steps{ checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.wmi.amu.edu.pl/s416138/s416138-mlworkshops']]]) } } stage('Copy results'){ steps { copyArtifacts filter: 'wikiniews_results.tsv', fingerprintArtifacts: true, projectName: 'ASR-eval', selector: lastSuccessful() } } stage('Count lines'){ steps{ sh label: '', script: './count_lines.sh wikiniews_results.tsv' } } stage('Count metrics'){ steps{ sh label: '', script: './count_metrics.sh wikiniews_results.tsv' } } stage('Get previous results'){ steps{ copyArtifacts filter: 'srr.txt, wer.txt', fingerprintArtifacts: true, optional: true, projectName: 's416138-metrics', target: 'last-results' } } } stage('Accumulate metrics results'){ when { expression { WER_EXISTS == 'true' && SRR_EXISTS == 'true'} } steps{ sh label: '', script: './append_to_file.sh last-results/srr.txt srr.txt' sh label: '', script: './append_to_file.sh last-results/wer.txt wer.txt' } } stage('Archive results'){ steps{ archiveArtifacts 'counted_lines.txt' archiveArtifacts 'srr.txt' archiveArtifacts 'wer.txt' archiveArtifacts 'wikiniews_results_with_wer.tsv' } } }