Refactor Jenkinsfile (#219)

* from master

* cleanup

* reorder
This commit is contained in:
Ethan Roseman 2021-03-23 11:22:30 +09:00 committed by GitHub
parent 042cb625b6
commit f04b7f1300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

37
Jenkinsfile vendored
View File

@ -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'
}
}
}