git - Jenkins - How do I publish coverage report to github -
i trying use github-pr-coverage-status-plugin, documentation says need run following on master branch:
step([$class: 'mastercoverageaction'])
but when add pipeline following error:
java.lang.unsupportedoperationexception: can't find git_url or change_url in envs: {branch_name=master, build_display_name=#41, build_id=41, build_number=41, build_tag=jenkins-testci-master-41, build_url=https://jnkns-ci.myserver.com/job/testci/job/master/41/, classpath=, hudson_home=/var/jenkins_home, hudson_server_cookie=01f6aedeea333d1f, hudson_url=https://jnkns-ci.myserver.com/, jenkins_home=/var/jenkins_home, jenkins_server_cookie=01f6aedeea333d1f, jenkins_url=https://jnkns-ci.myserver.com/, job_base_name=master, job_display_url=https://jnkns-ci.myserver.com/job/testci/job/master/display/redirect, job_name=testci/master, job_url=https://jnkns-ci.myserver.com/job/testci/job/master/, run_changes_display_url=https://jnkns-ci.myserver.com/job/testci/job/master/41/display/redirect?page=changes, run_display_url=https://jnkns-ci.myserver.com/job/testci/job/master/41/display/redirect} @ com.github.terma.jenkins.githubprcoveragestatus.pridandurlutils.getgiturl(pridandurlutils.java:85) @ com.github.terma.jenkins.githubprcoveragestatus.mastercoverageaction.perform(mastercoverageaction.java:71) @ org.jenkinsci.plugins.workflow.steps.corestep$execution.run(corestep.java:80) @ org.jenkinsci.plugins.workflow.steps.corestep$execution.run(corestep.java:67) @ org.jenkinsci.plugins.workflow.steps.synchronousnonblockingstepexecution$1$1.call(synchronousnonblockingstepexecution.java:49) @ hudson.security.acl.impersonate(acl.java:260) @ org.jenkinsci.plugins.workflow.steps.synchronousnonblockingstepexecution$1.run(synchronousnonblockingstepexecution.java:46) @ java.util.concurrent.executors$runnableadapter.call(executors.java:511) @ java.util.concurrent.futuretask.run(futuretask.java:266) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1149) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:624) @ java.lang.thread.run(thread.java:748) finished: failure
i have tried multiple ways inject these variables. in latest try, looked @ source code class, changed pipeline be:
pipeline { agent options { skipdefaultcheckout() } environment { // calling credentials() sets 3 environment variables // git_hub <username>:<password> // git_hub_user <username> // git_hub_psw <password> git_hub = credentials('tmhjenkins') docker_repo = 'mobilityhouse' docker_hub = credentials('tmhitadmin') git_url_property = "https://$git_hub@github.com/mobilityhouse/testci.git" } stages{ ... ... stage('coverage & tests') { steps { sh 'pip3 install -e .' sh 'make coverage-xml' script { currentbuild.result = 'success' sh(script: 'export git_url_property="https://$git_hub@github.com/mobilityhouse/testci.git"') env.git_url_property = "https://$git_hub@github.com/mobilityhouse/testci.git" step([$class: 'mastercoverageaction']) } } } ...
}
alas, fails too. how supposed use plugin within pipeline? appreciated.
Comments
Post a Comment