forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build docker immediately after tarballs
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
- Loading branch information
Showing
1 changed file
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
|
||
} | ||
} | ||
} | ||
} |