Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --component support for jenkins build pipelines #2095

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions jenkins/opensearch-dashboards/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ pipeline {
AGENT_ARM64 = 'Jenkins-Agent-al2-arm64-c6g4xlarge-Docker-Host'
}
parameters {
string(
name: 'COMPONENT_NAME',
description: 'If this field contains a component name (e.g. OpenSearch-Dashboards), will build with "--component <COMPONENT_NAME>", else build everything in the INPUT_MANIFEST.',
trim: true
)
string(
name: 'INPUT_MANIFEST',
description: 'Input manifest under the manifests folder, e.g. 2.0.0/opensearch-dashboards-2.0.0.yml.',
Expand Down Expand Up @@ -49,8 +54,8 @@ pipeline {
stage('detect docker image + args') {
agent {
docker {
label 'Jenkins-Agent-al2-x64-c54xlarge-Docker-Host'
image 'opensearchstaging/ci-runner:centos7-x64-arm64-jdkmulti-node10.24.1-cypress6.9.1-20211028'
label AGENT_X64
image 'alpine:3'
alwaysPull true
}
}
Expand All @@ -75,6 +80,7 @@ pipeline {
steps {
script {
def buildManifestObj = buildAssembleUpload(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'x64',
Expand Down Expand Up @@ -161,6 +167,7 @@ pipeline {
steps {
script {
def buildManifestObj = buildAssembleUpload(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'x64',
Expand Down Expand Up @@ -221,6 +228,7 @@ pipeline {
steps {
script {
buildArchive(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'arm64',
Expand All @@ -246,6 +254,7 @@ pipeline {
steps {
script {
def buildManifestObj = archiveAssembleUpload(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'arm64',
Expand Down Expand Up @@ -336,6 +345,7 @@ pipeline {
steps {
script {
buildArchive(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'arm64',
Expand All @@ -361,6 +371,7 @@ pipeline {
steps {
script {
def buildManifestObj = archiveAssembleUpload(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
platform: 'linux',
architecture: 'arm64',
Expand Down
19 changes: 15 additions & 4 deletions jenkins/opensearch/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ pipeline {
AGENT_ARM64 = 'Jenkins-Agent-al2-arm64-c6g4xlarge-Docker-Host'
}
parameters {
string(
name: 'COMPONENT_NAME',
description: 'If this field contains a component name (e.g. OpenSearch), will build with "--component <COMPONENT_NAME>", else build everything in the INPUT_MANIFEST.',
trim: true
)
string(
name: 'INPUT_MANIFEST',
description: 'Input manifest under the manifests folder, e.g. 2.0.0/opensearch-2.0.0.yml.',
Expand Down Expand Up @@ -44,8 +49,8 @@ pipeline {
stage('detect docker image + args') {
agent {
docker {
label 'Jenkins-Agent-al2-x64-c54xlarge-Docker-Host'
image 'opensearchstaging/ci-runner:centos7-x64-arm64-jdkmulti-node10.24.1-cypress6.9.1-20211028'
label AGENT_X64
image 'alpine:3'
alwaysPull true
}
}
Expand All @@ -64,7 +69,7 @@ pipeline {
}
agent {
docker {
label 'Jenkins-Agent-al2-x64-c54xlarge-Docker-Host'
label AGENT_X64
image dockerAgent.image
args dockerAgent.args
alwaysPull true
Expand All @@ -73,6 +78,7 @@ pipeline {
steps {
script {
buildManifest(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
distribution: 'tar',
snapshot: true
Expand Down Expand Up @@ -103,7 +109,7 @@ pipeline {
stage('build-snapshot-arm64-tar') {
agent {
docker {
label 'Jenkins-Agent-al2-arm64-c6g4xlarge-Docker-Host'
label AGENT_ARM64
image dockerAgent.image
args dockerAgent.args
alwaysPull true
Expand All @@ -112,6 +118,7 @@ pipeline {
steps {
script {
buildManifest(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
distribution: 'tar',
snapshot: true
Expand Down Expand Up @@ -141,6 +148,7 @@ pipeline {
steps {
script {
def buildManifestObj = buildAssembleUpload(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
distribution: "tar"
)
Expand Down Expand Up @@ -225,6 +233,7 @@ pipeline {
steps {
script {
def buildManifestObj = buildAssembleUpload(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
distribution: "rpm"
)
Expand Down Expand Up @@ -280,6 +289,7 @@ pipeline {
steps {
script {
def buildManifestObj = buildAssembleUpload(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
distribution: "tar"
)
Expand Down Expand Up @@ -363,6 +373,7 @@ pipeline {
steps {
script {
def buildManifestObj = buildAssembleUpload(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
distribution: "rpm"
)
Expand Down
1 change: 1 addition & 0 deletions vars/buildManifest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ void call(Map args = [:]) {
'./build.sh',
args.inputManifest ?: "manifests/${INPUT_MANIFEST}",
args.distribution ? "-d ${args.distribution}" : null,
args.componentName ? "--component ${args.componentName}" : null,
args.platform ? "-p ${args.platform}" : null,
args.architecture ? "-a ${args.architecture}" : null,
args.snapshot ? '--snapshot' : null,
Expand Down