Skip to content

Commit

Permalink
Remove hardcode git clone for the jenkins (#2038)
Browse files Browse the repository at this point in the history
* Remove hardcode git clone for the jenkins

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Update txt tests

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon committed Apr 26, 2022
1 parent 12ebdae commit dcfc3f0
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 14 deletions.
1 change: 0 additions & 1 deletion jenkins/vulnerability-scan/whitesource-scan.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
4 changes: 0 additions & 4 deletions tests/jenkins/jobs/DetectDockerImage_Jenkinsfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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})
Expand All @@ -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})
Expand All @@ -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})
Expand Down
2 changes: 0 additions & 2 deletions vars/buildDockerImage.groovy
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions vars/detectDockerAgent.groovy
Original file line number Diff line number Diff line change
@@ -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))
Expand All @@ -10,4 +9,4 @@ Map call(Map args = [:]) {
image: dockerImage,
args: dockerArgs
]
}
}

0 comments on commit dcfc3f0

Please sign in to comment.