diff --git a/Jenkins/Phabricator-pipeline/Jenkinsfile b/Jenkins/Phabricator-pipeline/Jenkinsfile index fdf6c3a..8fda182 100644 --- a/Jenkins/Phabricator-pipeline/Jenkinsfile +++ b/Jenkins/Phabricator-pipeline/Jenkinsfile @@ -21,6 +21,9 @@ pipeline { environment { CONDUIT_TOKEN = credentials('phabricator-conduit-token') 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 { stage("build info"){ @@ -41,37 +44,48 @@ pipeline { } stage('arc patch') { steps { - sh 'python3 ${WORKSPACE}/llvm-premerge-checks/scripts/phabtalk/apply_patch.py' + sh "python3 ${SCRIPT_DIR}/phabtalk/apply_patch.py" } } stage('CMake') { steps { - sh 'llvm-premerge-checks/scripts/run_cmake.sh' + sh "${SCRIPT_DIR}/run_cmake.sh" } } stage('ninja all') { steps { - sh 'llvm-premerge-checks/scripts/run_ninja.sh all' + sh "${SCRIPT_DIR}/run_ninja.sh all" } } stage('ninja check') { steps { - sh 'llvm-premerge-checks/scripts/run_ninja.sh check' + sh "${SCRIPT_DIR}/run_ninja.sh check" } } stage('ninja check-all') { steps { - sh 'llvm-premerge-checks/scripts/run_ninja.sh check-all' + sh "${SCRIPT_DIR}/run_ninja.sh check-all" } } } post { 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}") { // 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 """ + 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/" + """ } } } \ No newline at end of file