Skip to content

Commit

Permalink
Added jenkinsfile job to auto-release maven artifacts (#2991)
Browse files Browse the repository at this point in the history
Signed-off-by: Rishabh Singh <[email protected]>

Signed-off-by: Rishabh Singh <[email protected]>
  • Loading branch information
rishabh6788 authored Dec 12, 2022
1 parent 4c3053d commit 5be84e1
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ pipeline {
parameters {
string(
name: 'BUILD_ID',
description: 'Build ID of the OpenSearch distribution artifacts to be staged.',
description: 'Build ID of the OpenSearch distribution artifacts to be staged and released',
trim: true
)
string(
name: 'VERSION',
description: 'Version of the OpenSearch distribution artifacts to be staged.',
description: 'Version of the OpenSearch distribution artifacts to be staged and released',
trim: true
)
}
Expand Down
61 changes: 61 additions & 0 deletions jenkins/opensearch-maven-release/publish-to-maven.jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
lib = library(identifier: '[email protected]', retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
]))

pipeline {
agent {
docker {
label 'Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host'
image 'opensearchstaging/ci-runner:centos7-x64-arm64-jdkmulti-node10.24.1-cypress6.9.1-20211130'
alwaysPull true
}
}
parameters {
string(
name: 'BUILD_ID',
description: 'Build ID of the OpenSearch distribution artifacts to be staged.',
trim: true
)
string(
name: 'VERSION',
description: 'Version of the OpenSearch distribution artifacts to be staged.',
trim: true
)
}
environment {
ARTIFACT_PATH = "distribution-build-opensearch/${VERSION}/${BUILD_ID}/linux/x64/tar/builds"
ARTIFACT_BUCKET_NAME = credentials('jenkins-artifact-bucket-name')
REPO_URL = "https://aws.oss.sonatype.org/"
STAGING_PROFILE_ID = "${SONATYPE_STAGING_PROFILE_ID}"
BUILD_ID = "${BUILD_ID}"
}
stages {
stage('sign-stage-and-release') {
steps {
script {
echo "Downloading from S3."
downloadFromS3(
destPath: "$WORKSPACE/artifacts",
bucket: "${ARTIFACT_BUCKET_NAME}",
path: "${ARTIFACT_PATH}/",
force: true
)
echo "Signing, Staging and Publishing Maven artifacts."
publishToMaven(
signingArtifactsPath: "$WORKSPACE/artifacts/$ARTIFACT_PATH/opensearch/manifest.yml",
mavenArtifactsPath: "$WORKSPACE/artifacts/$ARTIFACT_PATH/opensearch/maven",
autoPublish: true
)
}
}
}
}
post() {
always {
script {
postCleanup()
}
}
}
}

0 comments on commit 5be84e1

Please sign in to comment.