From 7c2984675ed57320e97278e7d26a104502244f70 Mon Sep 17 00:00:00 2001 From: Adam Kolodziejczyk Date: Thu, 12 Dec 2024 10:51:22 +0100 Subject: [PATCH] SNOW-1852300 use bptp-built tag for svn_revision (#2001) --- Jenkinsfile | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8956bd92b..9b6e8ab3f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -46,16 +46,6 @@ timestamps { '''.stripMargin() } - def commit_hash = "main" // default which we want to override - def bptp_tag = "bptp-built" - try { - def response = authenticatedGithubCall("https://api.github.com/repos/snowflakedb/snowflake/git/ref/tags/${bptp_tag}") - commit_hash = response.object.sha - } catch (Exception e) { - println("error when calling Github API: ${e.message}") - e.printStackTrace() - } - jdkToParams = ['openjdk8': 'jdbc-centos7-openjdk8', 'openjdk11': 'jdbc-centos7-openjdk11', 'openjdk17': 'jdbc-centos7-openjdk17', 'openjdk21': 'jdbc-centos7-openjdk21'].collectEntries { jdk, image -> return [(jdk): [ string(name: 'client_git_branch', value: scmInfo.GIT_BRANCH), @@ -66,7 +56,7 @@ timestamps { string(name: 'parent_build_number', value: env.BUILD_NUMBER), string(name: 'timeout_value', value: '420'), string(name: 'PR_Key', value: scmInfo.GIT_BRANCH.substring(3)), - string(name: 'svn_revision', value: commit_hash) + string(name: 'svn_revision', value: 'bptp-built') ]] } @@ -108,34 +98,6 @@ timestamps { } } -// Generic github API function -// url : API url to call get command -def authenticatedGithubCall(url) { - withCredentials([ - usernamePassword(credentialsId: 'jenkins-snowflakedb-github-app', - usernameVariable: 'GITHUB_USER', - passwordVariable: 'GITHUB_TOKEN'), - ]) { - try { - def encodedAuth = Base64.getEncoder().encodeToString( - "${GITHUB_USER}:${GITHUB_TOKEN}".getBytes(java.nio.charset.StandardCharsets.UTF_8) - ) - def authHeaderValue = "Basic ${encodedAuth}" - def connection = new URL(url).openConnection() - connection.setRequestProperty("Authorization", authHeaderValue) - if (connection.getResponseCode() >= 300) { - println("ERROR: Status fetch from ${url} returned ${connection.getResponseCode()}") - println(connection.getErrorStream().getText()) - return null - } - return new groovy.json.JsonSlurperClassic().parseText(connection.getInputStream().getText()) - } catch(Exception e) { - println("Exception fetching ${url}: ${e}") - return null - } - } -} - def wgetUpdateGithub(String state, String folder, String targetUrl, String seconds) { def ghURL = "https://api.github.com/repos/snowflakedb/snowflake-jdbc/statuses/$COMMIT_SHA_LONG" def data = JsonOutput.toJson([state: "${state}", context: "jenkins/${folder}",target_url: "${targetUrl}"])