Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,11 @@ def getChangedDrivers() {
return drivers
}

def get_region() {
def url = env.JENKINS_URL?.trim()
if (url?.endsWith('/')) {
url = url[0..-2]
}

def region = url?.endsWith('.cn') ? 'cn' : 'global'
return region
}

// Gate artifactory-credentials for prod nodes in cn due to a docker authentication error arising in that environment
def getDockerCredentialId() {
def nodeLabel = params.NODE_LABEL ?: 'production'
def region = get_region()
if (nodeLabel == 'production' && region == 'cn') {
return 'artifactory-credentials'
}
else {
return ''
}
}
// Gate RegistryUrl for prod nodes in cn due to a docker authentication error arising in that environment
def getRegistryUrl() {
def nodeLabel = params.NODE_LABEL ?: 'production'
def region = get_region()
if (nodeLabel == 'production' && region == 'cn') {
return 'https://registry.artifactoryedge.streleng.cn'
} else {
// Default
return ''
}
}

pipeline {
agent {
docker {
image 'python:3.10'
label "${params.NODE_LABEL ?: 'production'}"
registryUrl getRegistryUrl()
registryCredentialsId getDockerCredentialId()
args '--entrypoint= -u 0:0'
}
}
Expand Down