Skip to content

Commit 7c29846

Browse files
SNOW-1852300 use bptp-built tag for svn_revision (snowflakedb#2001)
1 parent 322f909 commit 7c29846

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

Jenkinsfile

+1-39
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@ timestamps {
4646
'''.stripMargin()
4747
}
4848

49-
def commit_hash = "main" // default which we want to override
50-
def bptp_tag = "bptp-built"
51-
try {
52-
def response = authenticatedGithubCall("https://api.github.com/repos/snowflakedb/snowflake/git/ref/tags/${bptp_tag}")
53-
commit_hash = response.object.sha
54-
} catch (Exception e) {
55-
println("error when calling Github API: ${e.message}")
56-
e.printStackTrace()
57-
}
58-
5949
jdkToParams = ['openjdk8': 'jdbc-centos7-openjdk8', 'openjdk11': 'jdbc-centos7-openjdk11', 'openjdk17': 'jdbc-centos7-openjdk17', 'openjdk21': 'jdbc-centos7-openjdk21'].collectEntries { jdk, image ->
6050
return [(jdk): [
6151
string(name: 'client_git_branch', value: scmInfo.GIT_BRANCH),
@@ -66,7 +56,7 @@ timestamps {
6656
string(name: 'parent_build_number', value: env.BUILD_NUMBER),
6757
string(name: 'timeout_value', value: '420'),
6858
string(name: 'PR_Key', value: scmInfo.GIT_BRANCH.substring(3)),
69-
string(name: 'svn_revision', value: commit_hash)
59+
string(name: 'svn_revision', value: 'bptp-built')
7060
]]
7161
}
7262

@@ -108,34 +98,6 @@ timestamps {
10898
}
10999
}
110100

111-
// Generic github API function
112-
// url : API url to call get command
113-
def authenticatedGithubCall(url) {
114-
withCredentials([
115-
usernamePassword(credentialsId: 'jenkins-snowflakedb-github-app',
116-
usernameVariable: 'GITHUB_USER',
117-
passwordVariable: 'GITHUB_TOKEN'),
118-
]) {
119-
try {
120-
def encodedAuth = Base64.getEncoder().encodeToString(
121-
"${GITHUB_USER}:${GITHUB_TOKEN}".getBytes(java.nio.charset.StandardCharsets.UTF_8)
122-
)
123-
def authHeaderValue = "Basic ${encodedAuth}"
124-
def connection = new URL(url).openConnection()
125-
connection.setRequestProperty("Authorization", authHeaderValue)
126-
if (connection.getResponseCode() >= 300) {
127-
println("ERROR: Status fetch from ${url} returned ${connection.getResponseCode()}")
128-
println(connection.getErrorStream().getText())
129-
return null
130-
}
131-
return new groovy.json.JsonSlurperClassic().parseText(connection.getInputStream().getText())
132-
} catch(Exception e) {
133-
println("Exception fetching ${url}: ${e}")
134-
return null
135-
}
136-
}
137-
}
138-
139101
def wgetUpdateGithub(String state, String folder, String targetUrl, String seconds) {
140102
def ghURL = "https://api.github.com/repos/snowflakedb/snowflake-jdbc/statuses/$COMMIT_SHA_LONG"
141103
def data = JsonOutput.toJson([state: "${state}", context: "jenkins/${folder}",target_url: "${targetUrl}"])

0 commit comments

Comments
 (0)