This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.json.JsonSlurper | |
def call() { | |
def coverageUrl = "${env.BUILD_URL}coverage/api/json?pretty=true" | |
echo "Getting ${coverageUrl}" | |
// Fetch the JSON coverage report with authentication | |
def jsonResponse = "" | |
withCredentials([string(credentialsId: 'jenkins-user-credential', variable: 'PASSWORD')]) { | |
def url = new URL(coverageUrl) | |
def connection = (HttpURLConnection) url.openConnection() |