diff --git a/pipelines/Cloud/Deploy/Backend/msg-files-deploy.groovy b/pipelines/Cloud/Deploy/Backend/msg-files-deploy.groovy index 9218f0b..b990712 100644 --- a/pipelines/Cloud/Deploy/Backend/msg-files-deploy.groovy +++ b/pipelines/Cloud/Deploy/Backend/msg-files-deploy.groovy @@ -5,7 +5,6 @@ import tech.avroid.scm.Git import tech.avroid.jenkins.Notifications import tech.avroid.jenkins.Jenkins -String projectName = 'cloud' // Replace with your Harbor project name String repositoryName = 'msg-files' // Replace with your Harbor repository name String k8sAppName = repositoryName Map envBranch = [ @@ -13,8 +12,6 @@ Map envBranch = [ 'TEST': 'test' ] -String apiUrl = "https://${JENKINS_DOCKER_REGISTRY}/api/v2.0/projects/${projectName}" + - "/repositories/${repositoryName}/artifacts" properties([ buildDiscarder(logRotator(artifactNumToKeepStr: '10', numToKeepStr: '10')), @@ -72,14 +69,13 @@ return imageVersions ]) ]) -String repoPath = 'Apps-Backend/msg-files.git' -String branch = envBranch.find { it.key == params.ENV }?.value +String repoPath = "Apps-Backend/${repositoryName}.git" +String branch = envBranch.find { it.key == params.ENV }?.value String valuesPath = ".helm/values.${params.ENV.toLowerCase()}.yaml" String namespace = "tavro-cloud-${params.ENV.toLowerCase()}" -String helmChart = 'msg-files' -String helmRepoPath = "avroid/${helmChart}" +String helmRepoPath = "avroid/${repositoryName}" String helmRepo = "${env.JENKINS_NEXUS_URL}/repository/devops-helm-release" println(branch) Git git = new Git(this, env.JENKINS_GIT_CREDENTIALS_SSH) diff --git a/pipelines/Cloud/Deploy/Backend/msg-messenger-core-api-deploy.groovy b/pipelines/Cloud/Deploy/Backend/msg-messenger-core-api-deploy.groovy index d6b0953..06136f9 100644 --- a/pipelines/Cloud/Deploy/Backend/msg-messenger-core-api-deploy.groovy +++ b/pipelines/Cloud/Deploy/Backend/msg-messenger-core-api-deploy.groovy @@ -5,17 +5,13 @@ import tech.avroid.scm.Git import tech.avroid.jenkins.Notifications import tech.avroid.jenkins.Jenkins -String projectName = 'cloud' // Replace with your Harbor project name String repositoryName = 'msg-messenger-core-api' // Replace with your Harbor repository name String k8sAppName = repositoryName -String pageSize = 100 // maximum number of artifacts to return 100 Map envBranch = [ 'DEV': 'develop', 'TEST': 'test' ] -String apiUrl = "https://${JENKINS_DOCKER_REGISTRY}/api/v2.0/projects/${projectName}" + - "/repositories/${repositoryName}/artifacts" properties([ buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '10', @@ -54,8 +50,8 @@ def createGetHttpClient(String url, String jenkinsCreds) { return httpClient } -String harborApiUrl = "https://${JENKINS_DOCKER_REGISTRY}/api/v2.0/projects/cloud/repositories/msg-messenger-core-api/" + - "artifacts?page=1&page_size=100&with_tag=true&sort=-push_time" +String harborApiUrl = "https://${JENKINS_DOCKER_REGISTRY}/api/v2.0/projects/cloud/repositories/" + + "msg-messenger-core-api/artifacts?page=1&page_size=100&with_tag=true&sort=-push_time" def httpClientHarbor = createGetHttpClient(harborApiUrl, "${JENKINS_HARBOR_CREDENTIALS}") httpClientHarbor.connect() @@ -75,14 +71,12 @@ return imageVersions ]) ]) -String repoPath = 'Apps-Backend/msg-messenger-core-api.git' -String branch = envBranch.find { it.key == params.ENV }?.value +String repoPath = "Apps-Backend/${repositoryName}.git" +String branch = envBranch.find { it.key == params.ENV }?.value String valuesPath = ".helm/values.${params.ENV.toLowerCase()}.yaml" String namespace = "tavro-cloud-${params.ENV.toLowerCase()}" - -String helmChart = 'msg-messenger-core-api' -String helmRepoPath = "avroid/${helmChart}" +String helmRepoPath = "avroid/${repositoryName}" String helmRepo = "${env.JENKINS_NEXUS_URL}/repository/devops-helm-release" println(branch) Git git = new Git(this, env.JENKINS_GIT_CREDENTIALS_SSH) diff --git a/pipelines/Cloud/Deploy/Backend/msg-profiles-deploy.groovy b/pipelines/Cloud/Deploy/Backend/msg-profiles-deploy.groovy index 93998d4..2172eb4 100644 --- a/pipelines/Cloud/Deploy/Backend/msg-profiles-deploy.groovy +++ b/pipelines/Cloud/Deploy/Backend/msg-profiles-deploy.groovy @@ -5,17 +5,13 @@ import tech.avroid.scm.Git import tech.avroid.jenkins.Notifications import tech.avroid.jenkins.Jenkins -String projectName = 'cloud' // Replace with your Harbor project name -String repositoryName = 'msg-profiles' // Replace with your Harbor repository name +String repositoryName = 'msg-profiles' String k8sAppName = repositoryName -String pageSize = 100 // maximum number of artifacts to return 100 Map envBranch = [ 'DEV': 'develop', 'TEST': 'test' ] -String apiUrl = "https://${JENKINS_DOCKER_REGISTRY}/api/v2.0/projects/${projectName}" + - "/repositories/${repositoryName}/artifacts" properties([ buildDiscarder(logRotator(artifactNumToKeepStr: '10', numToKeepStr: '10')), @@ -73,14 +69,12 @@ return imageVersions ]) ]) -String repoPath = 'Apps-Backend/msg-profiles.git' -String branch = envBranch.find { it.key == params.ENV }?.value +String repoPath = "Apps-Backend/${repositoryName}.git" +String branch = envBranch.find { it.key == params.ENV }?.value String valuesPath = ".helm/values.${params.ENV.toLowerCase()}.yaml" String namespace = "tavro-cloud-${params.ENV.toLowerCase()}" - -String helmChart = 'msg-profiles' -String helmRepoPath = "avroid/${helmChart}" +String helmRepoPath = "avroid/${repositoryName}" String helmRepo = "${env.JENKINS_NEXUS_URL}/repository/devops-helm-release" println(branch) Git git = new Git(this, env.JENKINS_GIT_CREDENTIALS_SSH) diff --git a/pipelines/Cloud/Deploy/Backend/openresty-deploy.groovy b/pipelines/Cloud/Deploy/Backend/openresty-deploy.groovy index 34eddf9..a44d30e 100644 --- a/pipelines/Cloud/Deploy/Backend/openresty-deploy.groovy +++ b/pipelines/Cloud/Deploy/Backend/openresty-deploy.groovy @@ -18,7 +18,7 @@ String branch = 'master' String valuesPath = 'avroid.local/api-gateway/openresty' String namespace = 'api-gateway' String helmChart = 'openresty' -String helmRepoPath = 'avroid/openresty' +String helmRepoPath = "avroid/${helmChart}" String helmRepo = "${env.JENKINS_NEXUS_URL}/repository/devops-helm-release" Map configuration = [ @@ -28,7 +28,7 @@ Map configuration = [ ] List dockerCreds = [ - [path: 'team-devops/services/ci-cd/Jenkins/jenkins.avroid.tech', engineVersion: 2, + [path: 'team-devops/services/ci-cd/Jenkins/jenkins.avroid.tech', engineVersion: 2, secretValues: [ [vaultKey: 'k8s_jenkins_deploy_token'],