Skip to content

Commit

Permalink
Build docker immediately after tarballs
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
  • Loading branch information
gaiksaya committed Nov 9, 2024
1 parent ea478af commit 8705425
Showing 1 changed file with 112 additions and 0 deletions.
112 changes: 112 additions & 0 deletions jenkins/opensearch/test-dist.jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

lib = library(identifier: 'jenkins@7.2.1', retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
]))

pipeline {
agent none
environment {
AGENT_LINUX_X64 = 'Jenkins-Agent-AL2023-X64-M54xlarge-Docker-Host'
AGENT_LINUX_ARM64 = 'Jenkins-Agent-AL2023-Arm64-M6g4xlarge-Docker-Host'
AGENT_WINDOWS_X64 = 'Jenkins-Agent-Windows2019-X64-M54xlarge-Docker-Host'
IMAGE_LINUX_RPM = 'opensearchstaging/ci-runner:ci-runner-almalinux8-opensearch-build-v1' // required for rpm to create digest sha256 correctly with rpm 4.12+, still define here for 1.x version as 2.x+ moved to rockylinux8, later almalinux8, already
IMAGE_LINUX_DEB = 'opensearchstaging/ci-runner:ci-runner-ubuntu2004-opensearch-build-v2' // required for deb to create pkg using debmake/debuild/debhelper
IMAGE_WINDOWS_ZIP = 'opensearchstaging/ci-runner:ci-runner-windows2019-opensearch-build-v1' // required for windows to build zip distribution
}
stages {
stage('build') {
parallel {
stage('build-and-test-linux-x64-tar') {
agent {
docker {
label AGENT_LINUX_X64
image dockerAgent.image
args dockerAgent.args
registryUrl 'https://public.ecr.aws/'
alwaysPull true
}
}
steps {
script {
echo 'Stage 1'
sleep 30
}
}
post {
success {
script {
env.TAR_X64_SUCCESS = 'true'
}
}
}
}
stage('build-and-test-linux-arm64-tar') {
agent {
docker {
label AGENT_LINUX_ARM64
image dockerAgent.image
args dockerAgent.args
registryUrl 'https://public.ecr.aws/'
alwaysPull true
}
}
steps {
script {
echo 'Stage 3'
sleep 30
}
}
post {
success {
script {
env.TAR_ARM64_SUCCESS = 'true'
}
}
}
}
stage('docker build') {
steps {
script {
waitUntil {
return (env.TAR_X64_SUCCESS == 'true' && env.TAR_ARM64_SUCCESS == 'true')
}
}
}
agent {
docker {
label AGENT_LINUX_X64
image dockerAgent.image
args dockerAgent.args
registryUrl 'https://public.ecr.aws/'
alwaysPull true
}
}
steps {
script {
echo 'Docker build done'
}
}
}
}
}
}
post {
always {
node(AGENT_LINUX_X64) {
script {
postCleanup()
}

}
}
}
}

0 comments on commit 8705425

Please sign in to comment.