Skip to content

Commit

Permalink
Run promotion jobs parallely
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
  • Loading branch information
gaiksaya committed Jun 6, 2024
1 parent 9eb06c9 commit 0cfc5e2
Showing 1 changed file with 150 additions and 0 deletions.
150 changes: 150 additions & 0 deletions jenkins/promotion/test-parallel.jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
/*
* 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@5.11.1', retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
]))

pipeline {
options {
timeout(time: 4, unit: 'HOURS')
}
agent none
environment {
AGENT_LINUX_X64 = 'Jenkins-Agent-AL2023-X64-C54xlarge-Docker-Host'
}
parameters {
string(
name: 'RELEASE_VERSION',
description: 'Release version',
trim: true
)
string(
name: 'OPENSEARCH_RC_BUILD_NUMBER',
description: 'OpenSearch Release Candidate Build Number',
trim: true
)
string(
name: 'OPENSEARCH_DASHBOARDS_RC_BUILD_NUMBER',
description: 'OpenSearch Dashboards Release Candidate Build Number',
trim: true
)
}
stages {
stage('Parameters Check') {
steps {
script {
currentBuild.description = """RELEASE: ${RELEASE_VERSION}<br>OS_RC: ${OPENSEARCH_RC_BUILD_NUMBER}<br>OSD_RC: ${OPENSEARCH_DASHBOARDS_RC_BUILD_NUMBER}"""
if(RELEASE_VERSION.isEmpty() || OPENSEARCH_RC_BUILD_NUMBER.isEmpty() || OPENSEARCH_DASHBOARDS_RC_BUILD_NUMBER.isEmpty()) {
currentBuild.result = 'ABORTED'
error('Make sure all the parameters are passed in.')
}
}
}
}
stage('Publish'){
parallel {
stage('OpenSearch Debian Apt promotion') {
agent {
docker {
label AGENT_LINUX_X64
image 'docker/library/alpine:3'
registryUrl 'https://public.ecr.aws/'
alwaysPull true
}
}
steps {
echo 'Triggering distribution-promote-repos for OpenSearch Debian Apt'
echo 'Promotion successful for Debian Apt OpenSearch!'
}
}
stage('OpenSearch Yum promotion') {
agent {
docker {
label AGENT_LINUX_X64
image 'docker/library/alpine:3'
registryUrl 'https://public.ecr.aws/'
alwaysPull true
}
}
steps {
echo 'Triggering distribution-promote-repos for OpenSearch Yum'
echo 'Promotion successful for OpenSearch yum!'
}
}
stage('OpenSearch Dashboards Debian Apt promotion') {
agent {
docker {
label AGENT_LINUX_X64
image 'docker/library/alpine:3'
registryUrl 'https://public.ecr.aws/'
alwaysPull true
}
}
steps {
echo 'Triggering distribution-promote-repos for OpenSearch Dashboards apt'
echo 'Promotion successful for Debian Apt OpenSearch Dashboards!'
}
}
stage('OpenSearch Dashboards Yum promotion') {
agent {
docker {
label AGENT_LINUX_X64
image 'docker/library/alpine:3'
registryUrl 'https://public.ecr.aws/'
alwaysPull true
}
}
steps {
echo 'Promotion successful for OpenSearch Dashboards yum!'
}
}
stage('OpenSearch Dashboards Linux tar x64') {
agent {
docker {
label AGENT_LINUX_X64
image 'docker/library/alpine:3'
registryUrl 'https://public.ecr.aws/'
alwaysPull true
}
}
steps {
echo 'Triggering distribution-promote-artifacts for OpenSearch Dashboards Linux tar x64'
echo 'Promotion successful for OpenSearch Dashboards Linux tar x64!'
}
}
}
}
stage('Publish OpenSearch Linux tar x64') {
agent {
docker {
label AGENT_LINUX_X64
image 'docker/library/alpine:3'
registryUrl 'https://public.ecr.aws/'
alwaysPull true
}
}
steps {
echo 'Triggering distribution-promote-artifacts for OpenSearch Linux tar x64'
echo 'Promotion successful for OpenSearch Linux rpm x64!'
}
}
}
post {
always {
node(AGENT_LINUX_X64) {
checkout scm
script {
postCleanup()
}
}
}
}
}

0 comments on commit 0cfc5e2

Please sign in to comment.