2020-08-15 06:12:23 +02:00
|
|
|
pipeline {
|
2021-01-18 14:05:32 +01:00
|
|
|
agent {
|
2021-03-23 03:22:30 +01:00
|
|
|
label 'papermario'
|
2021-01-18 14:05:32 +01:00
|
|
|
}
|
2020-08-15 06:12:23 +02:00
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Setup') {
|
|
|
|
steps {
|
2021-02-22 10:21:23 +01:00
|
|
|
sh 'cp /usr/local/etc/roms/papermario.us.z64 ver/us/baserom.z64'
|
|
|
|
sh 'cp /usr/local/etc/roms/papermario.jp.z64 ver/jp/baserom.z64'
|
2021-08-22 23:55:26 +02:00
|
|
|
sh 'curl -L "https://github.com/pmret/gcc-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc'
|
|
|
|
sh 'curl -L "https://github.com/pmret/binutils-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc'
|
2021-08-25 20:08:35 +02:00
|
|
|
sh './configure --no-ccache'
|
2020-08-15 06:12:23 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2021-01-15 01:04:40 +01:00
|
|
|
sh 'ninja'
|
2020-08-15 06:12:23 +02:00
|
|
|
}
|
|
|
|
}
|
2021-08-24 12:22:24 +02:00
|
|
|
stage("Comment") {
|
|
|
|
when {
|
|
|
|
not {
|
|
|
|
branch 'master'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
if (env.CHANGE_ID) {
|
|
|
|
def us_progress = sh(returnStdout: true, script: "python3 progress.py us --pr-comment").trim()
|
|
|
|
def jp_progress = sh(returnStdout: true, script: "python3 progress.py jp --pr-comment").trim()
|
2021-08-24 15:30:35 +02:00
|
|
|
def warnings = sh(returnStdout: true, script: "./tools/warnings_count/check_new_warnings.sh --pr-message").trim()
|
2021-08-24 12:22:24 +02:00
|
|
|
def comment_id = -1
|
|
|
|
|
|
|
|
for (comment in pullRequest.comments) {
|
|
|
|
if (comment.user == "BowserSlug") {
|
|
|
|
comment_id = comment.id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-24 15:30:35 +02:00
|
|
|
def message = "${us_progress}\n${jp_progress}\n${warnings}"
|
2021-08-24 12:22:24 +02:00
|
|
|
|
2021-08-24 15:30:35 +02:00
|
|
|
if (message != "\n\n") {
|
2021-08-24 12:22:24 +02:00
|
|
|
if (comment_id == -1) {
|
|
|
|
pullRequest.comment(message)
|
|
|
|
} else {
|
|
|
|
pullRequest.editComment(comment_id, message)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-01-04 14:50:33 +01:00
|
|
|
stage('Report Progress') {
|
|
|
|
when {
|
|
|
|
branch 'master'
|
|
|
|
}
|
|
|
|
steps {
|
2021-03-23 03:22:30 +01:00
|
|
|
sh 'mkdir reports'
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
2021-08-24 15:30:35 +02:00
|
|
|
sh './tools/warnings_count/update_current_warnings.sh'
|
|
|
|
sh 'cp tools/warnings_count/warnings.txt reports/warnings.txt'
|
|
|
|
|
2021-03-23 03:22:30 +01:00
|
|
|
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'
|
2021-02-22 10:21:23 +01:00
|
|
|
|
2021-03-23 03:22:30 +01:00
|
|
|
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'
|
2021-08-24 15:30:35 +02:00
|
|
|
|
|
|
|
sh 'cat reports/warnings.txt > /var/www/papermar.io/html/reports/warnings.txt'
|
2021-01-04 14:50:33 +01:00
|
|
|
}
|
|
|
|
}
|
2020-08-15 06:12:23 +02:00
|
|
|
}
|
2021-08-24 12:22:24 +02:00
|
|
|
post {
|
|
|
|
always {
|
|
|
|
cleanWs()
|
|
|
|
}
|
|
|
|
}
|
2020-08-15 06:12:23 +02:00
|
|
|
}
|