Skip to content

Commit 8a4912e

Browse files
committed
Addressed review comments
1 parent abbbd3e commit 8a4912e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.citd/Jenkinsfilek8s

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ pipeline {
1919
GITHUB_URL = getGitHubUrl("${GITHUB_PRODUCTION_DEPLOY_URL}","${GITHUB_TEST_DEPLOY_URL}")
2020
GITHUB_PRODUCTION_DEPLOY_CREDENTIAL_ID ='GITHUB_MICROCHIP_PIC_AVR_EXAMPLES_TOKEN'
2121
GITHUB_TEST_DEPLOY_CREDENTIAL_ID ='GITHUB_PIC_AVR_TEST_TOKEN'
22-
PRODUCTION_DEPLOY_ORG = 'microchip-pic-avr-examples'
23-
TEST_DEPLOY_ORG = 'mchpTestArea'
2422
//Gets the Github credential id based on the deployment organization
25-
GITHUB_CREDENTIAL_ID = getGitHubCredentialId("${GITHUB_URL}","${PRODUCTION_DEPLOY_ORG}","${TEST_DEPLOY_ORG}","${GITHUB_PRODUCTION_DEPLOY_CREDENTIAL_ID}","${GITHUB_TEST_DEPLOY_CREDENTIAL_ID}")
23+
GITHUB_CREDENTIAL_ID = getGitHubCredentialId("${GITHUB_URL}","${GITHUB_PRODUCTION_DEPLOY_URL}","${GITHUB_TEST_DEPLOY_URL}","${GITHUB_PRODUCTION_DEPLOY_CREDENTIAL_ID}","${GITHUB_TEST_DEPLOY_CREDENTIAL_ID}")
2624
//Files or folders to be excluded from deployment, if multiple files or folders use comma separator
2725
DEPLOY_EXCLUDE_FOLDER_FILE_LIST = 'mchp_private'
2826
//Branch(s) to be deployed, if multiple branches use comma separator. ${env.BRANCH_NAME} is the target branch of the PR.
@@ -111,7 +109,7 @@ pipeline {
111109
def asString = topics.join(", ")
112110
asString = asString.replace("\n", "").replace(" ", "").replace("\t", "").replace("\r", "")
113111
Boolean visibility = true
114-
if(env.GITHUB_URL.contains(env.PRODUCTION_DEPLOY_ORG))
112+
if(env.GITHUB_URL == env.GITHUB_PRODUCTION_DEPLOY_URL)
115113
{
116114
visibility = false
117115
}
@@ -255,10 +253,10 @@ def getGitHubUrl(String productionUrl, String testDeployUrl) {
255253
}
256254
}
257255

258-
def getGitHubCredentialId(String deployUrl, String productionDeployOrg, String testDeployOrg, String githubProductionDeployCredential, String githubTestDeployCredential) {
259-
if(deployUrl.contains(productionDeployOrg)) {
256+
def getGitHubCredentialId(String deployUrl, String productionDeployUrl, String testDeployUrl, String githubProductionDeployCredential, String githubTestDeployCredential) {
257+
if(deployUrl == productionDeployUrl) {
260258
return githubProductionDeployCredential;
261-
} else if(deployUrl.contains(testDeployOrg)) {
259+
} else if(deployUrl == testDeployUrl) {
262260
return githubTestDeployCredential;
263261
} else {
264262
return null

0 commit comments

Comments
 (0)