diff --git a/Jenkinsfile b/Jenkinsfile index 3717f554a8..62142f9531 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,13 +1,6 @@ -def agentLabel -if (BRANCH_NAME == "master") { - agentLabel = "master" -} else { - agentLabel = "papermario" -} - pipeline { agent { - label agentLabel + label 'papermario' } stages { @@ -28,11 +21,31 @@ pipeline { branch 'master' } steps { - sh 'python3 progress.py us --csv >> /var/www/papermar.io/html/reports/progress_us.csv' - sh 'python3 progress.py us --shield-json > /var/www/papermar.io/html/reports/progress_us_shield.json' + sh 'mkdir reports' - sh 'python3 progress.py jp --csv >> /var/www/papermar.io/html/reports/progress_jp.csv' - sh 'python3 progress.py jp --shield-json > /var/www/papermar.io/html/reports/progress_jp_shield.json' + sh 'python3 progress.py us --csv >> reports/progress_us.csv' + sh 'python3 progress.py us --shield-json > reports/progress_us_shield.json' + + sh 'python3 progress.py jp --csv >> reports/progress_jp.csv' + sh 'python3 progress.py jp --shield-json > reports/progress_jp_shield.json' + + stash includes: 'reports/*', name: 'reports' + } + } + stage('Update Progress') { + when { + branch 'master' + } + agent { + label 'master' + } + steps { + unstash 'reports' + sh 'cat reports/progress_us.csv >> /var/www/papermar.io/html/reports/progress_us.csv' + sh 'cat reports/progress_us_shield.json > /var/www/papermar.io/html/reports/progress_us_shield.json' + + sh 'cat reports/progress_jp.csv >> /var/www/papermar.io/html/reports/progress_jp.csv' + sh 'cat reports/progress_jp_shield.json > /var/www/papermar.io/html/reports/progress_jp_shield.json' } } }