1+ @Library (' pipeline-utils' )
2+ import com.snowflake.DevEnvUtils
13import groovy.json.JsonOutput
24
35
46timestamps {
5- node(' parallelizable-c7 ' ) {
7+ node(' parallelizable-snowos ' ) {
68 stage(' checkout' ) {
79 scmInfo = checkout scm
810 println (" ${ scmInfo} " )
911 env. GIT_BRANCH = scmInfo. GIT_BRANCH
1012 env. GIT_COMMIT = scmInfo. GIT_COMMIT
13+ env. GIT_URL = scmInfo. GIT_URL
14+ }
15+
16+ stage(' Authenticate Artifactory' ) {
17+ script {
18+ new DevEnvUtils (). withSfCli {
19+ sh " sf artifact oci auth"
20+ }
21+ }
1122 }
1223
1324 stage(' Build' ) {
1425 withCredentials([
15- usernamePassword(credentialsId : ' 063fc85b-62a6-4181-9d72-873b43488411' , usernameVariable : ' AWS_ACCESS_KEY_ID' , passwordVariable : ' AWS_SECRET_ACCESS_KEY' ),
16- string(credentialsId : ' a791118f-a1ea-46cd-b876-56da1b9bc71c' ,variable : ' NEXUS_PASSWORD' )
26+ usernamePassword(credentialsId : ' 063fc85b-62a6-4181-9d72-873b43488411' , usernameVariable : ' AWS_ACCESS_KEY_ID' , passwordVariable : ' AWS_SECRET_ACCESS_KEY' )
1727 ]) {
1828 sh ''' \
1929 |cd $WORKSPACE
@@ -28,42 +38,10 @@ timestamps {
2838 ''' . stripMargin()
2939 }
3040 }
31- params = [
32- string(name : ' branch' , value : ' main' ),
33- string(name : ' client_git_commit' , value : scmInfo. GIT_COMMIT ),
34- string(name : ' client_git_branch' , value : scmInfo. GIT_BRANCH ),
35- string(name : ' parent_job' , value : env. JOB_NAME ),
36- string(name : ' parent_build_number' , value : env. BUILD_NUMBER ),
37- string(name : ' USE_PASSWORD' , value : ' true' )
38- ]
3941 parallel(
40- ' Test' : {
41- stage(' Test' ) {
42- try {
43- def commit_hash = " main" // default which we want to override
44- def bptp_tag = " bptp-stable"
45- def response = authenticatedGithubCall(" https://api.github.com/repos/snowflakedb/snowflake/git/ref/tags/${ bptp_tag} " )
46- commit_hash = response. object. sha
47- // Append the bptp-stable commit sha to params
48- params + = [string(name : ' svn_revision' , value : commit_hash)]
49- } catch (Exception e) {
50- println (" Exception computing commit hash from: ${ response} " )
51- }
52- parallel (
53- ' Test Python 39' : { build job : ' RT-PyConnector39-PC' ,parameters : params},
54- ' Test Python 310' : { build job : ' RT-PyConnector310-PC' ,parameters : params},
55- ' Test Python 311' : { build job : ' RT-PyConnector311-PC' ,parameters : params},
56- ' Test Python 312' : { build job : ' RT-PyConnector312-PC' ,parameters : params},
57- ' Test Python 313' : { build job : ' RT-PyConnector313-PC' ,parameters : params},
58- ' Test Python 39 OldDriver' : { build job : ' RT-PyConnector39-OldDriver-PC' ,parameters : params},
59- ' Test Python 39 FIPS' : { build job : ' RT-FIPS-PyConnector39' ,parameters : params},
60- )
61- }
62- },
6342 ' Test Authentication' : {
6443 stage(' Test Authentication' ) {
6544 withCredentials([
66- string(credentialsId : ' a791118f-a1ea-46cd-b876-56da1b9bc71c' , variable : ' NEXUS_PASSWORD' ),
6745 string(credentialsId : ' sfctest0-parameters-secret' , variable : ' PARAMETERS_SECRET' )
6846 ]) {
6947 sh ''' \
@@ -76,22 +54,48 @@ timestamps {
7654 ' Test WIF' : {
7755 stage(' Test WIF' ) {
7856 withCredentials([
79- string(credentialsId : ' sfctest0-parameters-secret' , variable : ' PARAMETERS_SECRET' )
57+ string(credentialsId : ' sfctest0-parameters-secret' , variable : ' PARAMETERS_SECRET' ),
58+ usernamePassword(credentialsId : ' jenkins-snowflakedb-github-app' ,
59+ usernameVariable : ' GITHUB_USER' ,
60+ passwordVariable : ' GITHUB_TOKEN' )
8061 ]) {
8162 sh ''' \
8263 |#!/bin/bash -e
8364 |$WORKSPACE/ci/test_wif.sh
8465 ''' . stripMargin()
8566 }
8667 }
68+ },
69+ ' Test Revocation Validation' : {
70+ stage(' Test Revocation Validation' ) {
71+ withCredentials([
72+ usernamePassword(credentialsId : ' jenkins-snowflakedb-github-app' ,
73+ usernameVariable : ' GITHUB_USER' ,
74+ passwordVariable : ' GITHUB_TOKEN' )
75+ ]) {
76+ try {
77+ sh ' $WORKSPACE/ci/test_revocation.sh'
78+ } finally {
79+ archiveArtifacts artifacts : ' revocation-results.json,revocation-report.html' , allowEmptyArchive : true
80+ publishHTML(target : [
81+ allowMissing : true ,
82+ alwaysLinkToLastBuild : true ,
83+ keepAll : true ,
84+ reportDir : ' .' ,
85+ reportFiles : ' revocation-report.html' ,
86+ reportName : ' Revocation Validation Report'
87+ ])
88+ }
89+ }
90+ }
8791 }
8892 )
8993 }
9094}
9195
9296
9397pipeline {
94- agent { label ' regular-memory-node' }
98+ agent { label ' regular-memory-node-snowos ' }
9599 options { timestamps() }
96100 environment {
97101 COMMIT_SHA_LONG = sh(returnStdout : true , script : " echo \$ (git rev-parse " + " HEAD)" ). trim()
0 commit comments