Skip to content

Commit

Permalink
Clean up buildDockerImage tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler committed Jan 31, 2022
1 parent 0fa4613 commit bd91902
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
4 changes: 3 additions & 1 deletion tests/jenkins/jobs/BuildDockerImage_Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ pipeline {
steps {
script {
buildDockerImage(
inputManifest: 'tests/jenkins/data/opensearch-1.3.0.yml'
inputManifest: 'tests/jenkins/data/opensearch-1.3.0.yml',
artifactUrlX64: env.ARTIFACT_URL_linux_x64,
artifactUrlArm64: env.ARTIFACT_URL_linux_arm64
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
BuildDockerImage_Jenkinsfile.echo(Executing on agent [label:none])
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})
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})
InputManifest.asBoolean()
buildDockerImage.echo(Skipping docker build, one of x64 or arm64 artifacts was not built.)
buildDockerImage.string({name=DOCKER_BUILD_GIT_REPOSITORY, value=https://github.com/opensearch-project/opensearch-build})
buildDockerImage.string({name=DOCKER_BUILD_GIT_REPOSITORY_REFERENCE, value=main})
buildDockerImage.string({name=DOCKER_BUILD_SCRIPT_WITH_COMMANDS, value=id && pwd && cd docker/release && curl -sSL opensearch.linux.x64 -o opensearch-x64.tgz && curl -sSL opensearch.linux.arm64 -o opensearch-arm64.tgz && bash build-image-multi-arch.sh -v 1.3.0 -f ./dockerfiles/opensearch.al2.dockerfile -p opensearch -a 'x64,arm64' -r opensearchstaging/opensearch -t 'opensearch-x64.tgz,opensearch-arm64.tgz' -n 33})
buildDockerImage.booleanParam({name=IS_STAGING, value=true})
buildDockerImage.build({job=docker-build, parameters=[null, null, null, null]})
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BuildDockerImage_Jenkinsfile.echo(Executing on agent [label:none])
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})
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})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BuildDockerImage_Jenkinsfile.echo(Executing on agent [label:none])
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})
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})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BuildDockerImage_Jenkinsfile.echo(Executing on agent [label:none])
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})
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})
Expand Down
16 changes: 13 additions & 3 deletions tests/jenkins/jobs/Build_OpenSearch_Dashboards_Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ pipeline {
}
steps {
script {
buildAssembleUpload(
def buildManifestObj = archiveAssembleUpload(
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'x64'
)

String artifactUrl = buildManifestObj.getArtifactUrl('bundle-build', '1')
env.ARTIFACT_URL_X64 = artifactUrl
echo "artifactUrl (x64): ${artifactUrl}"
}
}
post {
Expand Down Expand Up @@ -94,11 +98,15 @@ pipeline {
}
steps {
script {
archiveAssembleUpload(
def buildManifestObj = archiveAssembleUpload(
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'arm64'
)

String artifactUrl = buildManifestObj.getArtifactUrl('bundle-build', '1')
env.ARTIFACT_URL_ARM64 = artifactUrl
echo "artifactUrl (arm64): ${artifactUrl}"
}
}
post {
Expand All @@ -116,7 +124,9 @@ pipeline {
node('Jenkins-Agent-al2-x64-c54xlarge-Docker-Host') {
script {
buildDockerImage(
inputManifest: "manifests/${INPUT_MANIFEST}"
inputManifest: "manifests/${INPUT_MANIFEST}",
artifactUrlX64: env.ARTIFACT_URL_X64,
artifactUrlArm64: env.ARTIFACT_URL_ARM64
)
}
}
Expand Down

0 comments on commit bd91902

Please sign in to comment.