-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added jenkinsfile job to auto-release maven artifacts (#2991)
Signed-off-by: Rishabh Singh <[email protected]> Signed-off-by: Rishabh Singh <[email protected]>
- Loading branch information
1 parent
4c3053d
commit 5be84e1
Showing
2 changed files
with
63 additions
and
2 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
61 changes: 61 additions & 0 deletions
61
jenkins/opensearch-maven-release/publish-to-maven.jenkinsfile
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,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() | ||
} | ||
} | ||
} | ||
} |