1
0
Fork 0

added postprocessing for Phabricator

This commit is contained in:
Christian Kühnel 2019-10-24 04:46:45 -07:00
parent 2183901d46
commit 55a03f6fe7

View file

@ -21,6 +21,9 @@ pipeline {
environment { environment {
CONDUIT_TOKEN = credentials('phabricator-conduit-token') CONDUIT_TOKEN = credentials('phabricator-conduit-token')
PHABRICATOR_HOST = 'https://reviews.llvm.org' PHABRICATOR_HOST = 'https://reviews.llvm.org'
PHAB_LOG = "${WORKSPACE}/build/.phabricator-comment"
SCRIPT_DIR = "${WORKSPACE}/llvm-premerge-checks/scripts"
RESULT_URL = "http://results.llvm-merge-guard.org/${BUILD_ID}"
} }
stages { stages {
stage("build info"){ stage("build info"){
@ -41,37 +44,48 @@ pipeline {
} }
stage('arc patch') { stage('arc patch') {
steps { steps {
sh 'python3 ${WORKSPACE}/llvm-premerge-checks/scripts/phabtalk/apply_patch.py' sh "python3 ${SCRIPT_DIR}/phabtalk/apply_patch.py"
} }
} }
stage('CMake') { stage('CMake') {
steps { steps {
sh 'llvm-premerge-checks/scripts/run_cmake.sh' sh "${SCRIPT_DIR}/run_cmake.sh"
} }
} }
stage('ninja all') { stage('ninja all') {
steps { steps {
sh 'llvm-premerge-checks/scripts/run_ninja.sh all' sh "${SCRIPT_DIR}/run_ninja.sh all"
} }
} }
stage('ninja check') { stage('ninja check') {
steps { steps {
sh 'llvm-premerge-checks/scripts/run_ninja.sh check' sh "${SCRIPT_DIR}/run_ninja.sh check"
} }
} }
stage('ninja check-all') { stage('ninja check-all') {
steps { steps {
sh 'llvm-premerge-checks/scripts/run_ninja.sh check-all' sh "${SCRIPT_DIR}/run_ninja.sh check-all"
} }
} }
} }
post { post {
always { always {
echo "Console log is available at https://results.new.llvm-merge-guard.org/${BUILD_ID}" echo "Console log is available at ${RESULT_URL}"
dir("${env.TARGET_DIR}") { dir("${env.TARGET_DIR}") {
// copy console log to result folder // copy console log to result folder
sh "wget -qO console-log.txt http://jenkins-ui.jenkins.svc.cluster.local:8080/job/${JOB_BASE_NAME}/${BUILD_NUMBER}/consoleText" sh "wget -qO console-log.txt http://jenkins-ui.jenkins.svc.cluster.local:8080/job/${JOB_BASE_NAME}/${BUILD_NUMBER}/consoleText"
} }
sh """
cat > ${PHAB_LOG} << EOM
Log files: [[${RESULT_URL}/console-log.txt | console-log.txt]], [[${RESULT_URL}/CMakeCache.txt | CMakeCache.txt]]
EOM
${SCRIPT_DIR}/phabtalk/phabtalk.py "${PHID}" "${DIFF_ID}"
--conduit-token "${CONDUIT_TOKEN}" \
--test-result-file "${TEST_REPORT}" \
--comment-file "${PHAB_LOG}" \
--host "https://reviews.llvm.org/api/"
"""
} }
} }
} }