Skip to content

Commit 979342e

Browse files
committed
Hide internal repo url
Signed-off-by: Yuanjing Xue <[email protected]>
1 parent 8316779 commit 979342e

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

jenkins/GenerateLock.groovy

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ def createKubernetesPodConfig()
3838
return podConfig
3939
}
4040

41-
def getGitCredentialId (String repoUrl) {
42-
if (repoUrl ==~ /https:\/\/github\.com\/[\w\-]+\/[\w\-\.]+(\.git)?/) {
41+
def getGitCredentialId (String repoUrlKey) {
42+
if (repoUrlKey == "tensorrt_llm_github") {
4343
return 'github-token-trtllm-ci'
4444
}
45-
if (repoUrl ==~ /https:\/\/gitlab\-master\.nvidia\.com\/[\w\-]+\/[\w\-\.]+(\.git)?/) {
45+
if (repoUrlKey == "tensorrt_llm_internal") {
4646
return 'svc_tensorrt_gitlab_api_token'
4747
}
4848
return null
@@ -53,8 +53,16 @@ def generate()
5353
sh "pwd && ls -alh"
5454

5555
container("alpine") {
56-
def LLM_REPO = params.repoUrl
57-
if (LLM_REPO == "Custom Repo") {
56+
def LLM_REPO = "https://github.com/NVIDIA/TensorRT-LLM.git"
57+
if (LLM_REPO == "tensorrt_llm_internal") {
58+
withCredentials([string(credentialsId: 'default-llm-repo', variable: 'DEFAULT_LLM_REPO')]) {
59+
LLM_REPO = DEFAULT_LLM_REPO
60+
}
61+
}
62+
if (params.repoUrlKey == "custom_repo") {
63+
if (params.customRepoUrl == "") {
64+
throw new Exception("Invalid custom repo url provided")
65+
}
5866
LLM_REPO = params.customRepoUrl
5967
}
6068
def CREDENTIAL_ID = getGitCredentialId(LLM_REPO)
@@ -75,7 +83,7 @@ def generate()
7583
def count = sh(script: "git status --porcelain security_scanning/ | wc -l", returnStdout: true).trim()
7684
echo "Changed/untracked file count: ${count}"
7785
if (count == "0") {
78-
echo "No changes in Git"
86+
echo "No update that needs to be checked in"
7987
} else {
8088
sh "git status"
8189
sh "git add \$(find . -type f \\( -name 'poetry.lock' -o -name 'pyproject.toml' \\))"
@@ -99,8 +107,8 @@ pipeline {
99107
}
100108
parameters {
101109
string(name: 'branchName', defaultValue: 'main', description: 'the branch to generate the lock files')
102-
choice(name: 'repoUrl', choices: ['https://github.com/NVIDIA/TensorRT-LLM.git','https://gitlab-master.nvidia.com/ftp/tekit.git', 'Custom Repo'], description: "The repo url to process, choose \"Custom repo\" if you want to set your own repo")
103-
string(name: 'customRepoUrl', defaultValue: '', description: 'Your custom repo to get processed, need to select \"Custom repo\" for repoUrl, otherwise it will be ignored')
110+
choice(name: 'repoUrlKey', choices: ['tensorrt_llm_github','tensorrt_llm_internal', 'custom_repo'], description: "The repo url to process, choose \"custom_repo\" if you want to set your own repo")
111+
string(name: 'customRepoUrl', defaultValue: '', description: 'Your custom repo to get processed, need to select \"custom_repo\" for repoUrlKey, otherwise it will be ignored')
104112
}
105113
options {
106114
skipDefaultCheckout()

0 commit comments

Comments
 (0)