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

Added jenkinsfile job to auto-release maven artifacts #2991

Merged
merged 1 commit into from
Dec 12, 2022
Merged
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
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.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove to be staged since this workflow will be auto-promoting

trim: true
)
string(
name: 'VERSION',
description: 'Version of the OpenSearch distribution artifacts to be staged.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

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()
}
}
}
}