From dcfc3f0fb5a32bf32cdaa8e235dbf429f28c4b87 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 26 Apr 2022 13:44:27 -0400 Subject: [PATCH] Remove hardcode git clone for the jenkins (#2038) * Remove hardcode git clone for the jenkins Signed-off-by: Peter Zhu * Update txt tests Signed-off-by: Peter Zhu --- jenkins/vulnerability-scan/whitesource-scan.jenkinsfile | 1 - .../jenkins/jobs/BuildDockerImage_Jenkinsfile_builds_both.txt | 1 - .../jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_arm64.txt | 1 - .../jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_both.txt | 1 - tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_x64.txt | 1 - .../BuildDockerImage_Qualifier_Jenkinsfile_builds_both.txt | 1 - tests/jenkins/jobs/DetectDockerImage_Jenkinsfile.txt | 4 ---- vars/buildDockerImage.groovy | 2 -- vars/detectDockerAgent.groovy | 3 +-- 9 files changed, 1 insertion(+), 14 deletions(-) diff --git a/jenkins/vulnerability-scan/whitesource-scan.jenkinsfile b/jenkins/vulnerability-scan/whitesource-scan.jenkinsfile index d1be640a6b..ca9033c768 100644 --- a/jenkins/vulnerability-scan/whitesource-scan.jenkinsfile +++ b/jenkins/vulnerability-scan/whitesource-scan.jenkinsfile @@ -43,7 +43,6 @@ pipeline { } void scan() { - git url: 'https://github.com/opensearch-project/opensearch-build.git', branch: 'main' sh """ curl -SLO https://services.gradle.org/distributions/gradle-6.6.1-bin.zip unzip gradle-6.6.1-bin.zip diff --git a/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_builds_both.txt b/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_builds_both.txt index 9da8786aa5..f46ea635f2 100644 --- a/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_builds_both.txt +++ b/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_builds_both.txt @@ -4,7 +4,6 @@ BuildDockerImage_Jenkinsfile.stage(build docker image, groovy.lang.Closure) BuildDockerImage_Jenkinsfile.script(groovy.lang.Closure) BuildDockerImage_Jenkinsfile.buildDockerImage({inputManifest=tests/jenkins/data/opensearch-1.3.0.yml, artifactUrlX64=opensearch.linux.x64, artifactUrlArm64=opensearch.linux.arm64}) - buildDockerImage.git({url=https://github.com/opensearch-project/opensearch-build.git, branch=main}) buildDockerImage.legacySCM(groovy.lang.Closure) buildDockerImage.library({identifier=jenkins@20211123, retriever=null}) buildDockerImage.readYaml({file=tests/jenkins/data/opensearch-1.3.0.yml}) diff --git a/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_arm64.txt b/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_arm64.txt index ab84ae06b8..fab8619064 100644 --- a/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_arm64.txt +++ b/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_arm64.txt @@ -4,7 +4,6 @@ BuildDockerImage_Jenkinsfile.stage(build docker image, groovy.lang.Closure) BuildDockerImage_Jenkinsfile.script(groovy.lang.Closure) BuildDockerImage_Jenkinsfile.buildDockerImage({inputManifest=tests/jenkins/data/opensearch-1.3.0.yml, artifactUrlX64=opensearch.linux.x64, artifactUrlArm64=null}) - buildDockerImage.git({url=https://github.com/opensearch-project/opensearch-build.git, branch=main}) buildDockerImage.legacySCM(groovy.lang.Closure) buildDockerImage.library({identifier=jenkins@20211123, retriever=null}) buildDockerImage.readYaml({file=tests/jenkins/data/opensearch-1.3.0.yml}) diff --git a/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_both.txt b/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_both.txt index dce6048d79..808d78a7b2 100644 --- a/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_both.txt +++ b/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_both.txt @@ -4,7 +4,6 @@ BuildDockerImage_Jenkinsfile.stage(build docker image, groovy.lang.Closure) BuildDockerImage_Jenkinsfile.script(groovy.lang.Closure) BuildDockerImage_Jenkinsfile.buildDockerImage({inputManifest=tests/jenkins/data/opensearch-1.3.0.yml, artifactUrlX64=null, artifactUrlArm64=null}) - buildDockerImage.git({url=https://github.com/opensearch-project/opensearch-build.git, branch=main}) buildDockerImage.legacySCM(groovy.lang.Closure) buildDockerImage.library({identifier=jenkins@20211123, retriever=null}) buildDockerImage.readYaml({file=tests/jenkins/data/opensearch-1.3.0.yml}) diff --git a/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_x64.txt b/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_x64.txt index f42ba6f0f7..9ed3a5c498 100644 --- a/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_x64.txt +++ b/tests/jenkins/jobs/BuildDockerImage_Jenkinsfile_skips_x64.txt @@ -4,7 +4,6 @@ BuildDockerImage_Jenkinsfile.stage(build docker image, groovy.lang.Closure) BuildDockerImage_Jenkinsfile.script(groovy.lang.Closure) BuildDockerImage_Jenkinsfile.buildDockerImage({inputManifest=tests/jenkins/data/opensearch-1.3.0.yml, artifactUrlX64=null, artifactUrlArm64=opensearch.linux.arm64}) - buildDockerImage.git({url=https://github.com/opensearch-project/opensearch-build.git, branch=main}) buildDockerImage.legacySCM(groovy.lang.Closure) buildDockerImage.library({identifier=jenkins@20211123, retriever=null}) buildDockerImage.readYaml({file=tests/jenkins/data/opensearch-1.3.0.yml}) diff --git a/tests/jenkins/jobs/BuildDockerImage_Qualifier_Jenkinsfile_builds_both.txt b/tests/jenkins/jobs/BuildDockerImage_Qualifier_Jenkinsfile_builds_both.txt index fe2fdc263c..efdbb4d4f3 100644 --- a/tests/jenkins/jobs/BuildDockerImage_Qualifier_Jenkinsfile_builds_both.txt +++ b/tests/jenkins/jobs/BuildDockerImage_Qualifier_Jenkinsfile_builds_both.txt @@ -4,7 +4,6 @@ BuildDockerImage_Qualifier_Jenkinsfile.stage(build docker image, groovy.lang.Closure) BuildDockerImage_Qualifier_Jenkinsfile.script(groovy.lang.Closure) BuildDockerImage_Qualifier_Jenkinsfile.buildDockerImage({inputManifest=tests/jenkins/data/opensearch-2.0.0.yml, artifactUrlX64=opensearch.linux.x64, artifactUrlArm64=opensearch.linux.arm64}) - buildDockerImage.git({url=https://github.com/opensearch-project/opensearch-build.git, branch=main}) buildDockerImage.legacySCM(groovy.lang.Closure) buildDockerImage.library({identifier=jenkins@20211123, retriever=null}) buildDockerImage.readYaml({file=tests/jenkins/data/opensearch-2.0.0.yml}) diff --git a/tests/jenkins/jobs/DetectDockerImage_Jenkinsfile.txt b/tests/jenkins/jobs/DetectDockerImage_Jenkinsfile.txt index d42c241824..80b3e205a8 100644 --- a/tests/jenkins/jobs/DetectDockerImage_Jenkinsfile.txt +++ b/tests/jenkins/jobs/DetectDockerImage_Jenkinsfile.txt @@ -4,7 +4,6 @@ DetectDockerImage_Jenkinsfile.stage(opensearch-1.1.0, groovy.lang.Closure) DetectDockerImage_Jenkinsfile.script(groovy.lang.Closure) DetectDockerImage_Jenkinsfile.detectDockerAgent({manifest=manifests/1.1.0/opensearch-1.1.0.yml}) - detectDockerAgent.git({url=https://github.com/opensearch-project/opensearch-build.git, branch=main}) detectDockerAgent.legacySCM(groovy.lang.Closure) detectDockerAgent.library({identifier=jenkins@20211123, retriever=null}) detectDockerAgent.readYaml({file=manifests/1.1.0/opensearch-1.1.0.yml}) @@ -15,7 +14,6 @@ DetectDockerImage_Jenkinsfile.stage(opensearch-1.2.0, groovy.lang.Closure) DetectDockerImage_Jenkinsfile.script(groovy.lang.Closure) DetectDockerImage_Jenkinsfile.detectDockerAgent({manifest=manifests/1.2.0/opensearch-1.2.0.yml}) - detectDockerAgent.git({url=https://github.com/opensearch-project/opensearch-build.git, branch=main}) detectDockerAgent.legacySCM(groovy.lang.Closure) detectDockerAgent.library({identifier=jenkins@20211123, retriever=null}) detectDockerAgent.readYaml({file=manifests/1.2.0/opensearch-1.2.0.yml}) @@ -26,7 +24,6 @@ DetectDockerImage_Jenkinsfile.stage(opensearch-dashboards-1.1.0, groovy.lang.Closure) DetectDockerImage_Jenkinsfile.script(groovy.lang.Closure) DetectDockerImage_Jenkinsfile.detectDockerAgent({manifest=manifests/1.1.0/opensearch-dashboards-1.1.0.yml}) - detectDockerAgent.git({url=https://github.com/opensearch-project/opensearch-build.git, branch=main}) detectDockerAgent.legacySCM(groovy.lang.Closure) detectDockerAgent.library({identifier=jenkins@20211123, retriever=null}) detectDockerAgent.readYaml({file=manifests/1.1.0/opensearch-dashboards-1.1.0.yml}) @@ -37,7 +34,6 @@ DetectDockerImage_Jenkinsfile.stage(opensearch-dashboards-1.2.0, groovy.lang.Closure) DetectDockerImage_Jenkinsfile.script(groovy.lang.Closure) DetectDockerImage_Jenkinsfile.detectDockerAgent({manifest=manifests/1.2.0/opensearch-dashboards-1.2.0.yml}) - detectDockerAgent.git({url=https://github.com/opensearch-project/opensearch-build.git, branch=main}) detectDockerAgent.legacySCM(groovy.lang.Closure) detectDockerAgent.library({identifier=jenkins@20211123, retriever=null}) detectDockerAgent.readYaml({file=manifests/1.2.0/opensearch-dashboards-1.2.0.yml}) diff --git a/vars/buildDockerImage.groovy b/vars/buildDockerImage.groovy index 7c141f154d..6ee8cd4dd8 100644 --- a/vars/buildDockerImage.groovy +++ b/vars/buildDockerImage.groovy @@ -1,6 +1,4 @@ void call(Map args = [:]) { - git url: 'https://github.com/opensearch-project/opensearch-build.git', branch: 'main' - def lib = library(identifier: 'jenkins@20211123', retriever: legacySCM(scm)) def inputManifest = lib.jenkins.InputManifest.new(readYaml(file: args.inputManifest)) def build_qualifier = inputManifest.build.qualifier diff --git a/vars/detectDockerAgent.groovy b/vars/detectDockerAgent.groovy index fbd01b731c..9a7538beba 100644 --- a/vars/detectDockerAgent.groovy +++ b/vars/detectDockerAgent.groovy @@ -1,5 +1,4 @@ Map call(Map args = [:]) { - git url: 'https://github.com/opensearch-project/opensearch-build.git', branch: 'main' def lib = library(identifier: "jenkins@20211123", retriever: legacySCM(scm)) String manifest = args.manifest ?: "manifests/${INPUT_MANIFEST}" def inputManifest = lib.jenkins.InputManifest.new(readYaml(file: manifest)) @@ -10,4 +9,4 @@ Map call(Map args = [:]) { image: dockerImage, args: dockerArgs ] -} \ No newline at end of file +}