forked from opensearch-project/sql-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into release-drafter
Signed-off-by: YANGDB <yang.db.dev@gmail.com>
- Loading branch information
Showing
4 changed files
with
19 additions
and
97 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
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 |
---|---|---|
@@ -1,92 +1,16 @@ | ||
lib = library(identifier: 'jenkins@main', retriever: modernSCM([ | ||
lib = library(identifier: 'jenkins@1.5.3', retriever: modernSCM([ | ||
$class: 'GitSCMSource', | ||
remote: 'https://github.com/opensearch-project/opensearch-build.git', | ||
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:ci-runner-centos7-opensearch-build-v2' | ||
args '-e JAVA_HOME=/opt/java/openjdk-11' | ||
alwaysPull true | ||
} | ||
} | ||
options { | ||
timeout(time: 30, unit: 'MINUTES') | ||
throttleJobProperty( | ||
categories: [], | ||
limitOneJobWithMatchingParams: false, | ||
maxConcurrentPerNode: 0, | ||
maxConcurrentTotal: 1, | ||
paramsToUseForLimit: '', | ||
throttleEnabled: true, | ||
throttleOption: 'project', | ||
standardReleasePipelineWithGenericTrigger( | ||
tokenIdCredential: 'jenkins-sql-jdbc-opensearch-generic-webhook-token', | ||
causeString: 'A tag was cut on opensearch-project/sql-jdbc repository causing this workflow to run', | ||
downloadReleaseAsset: true, | ||
publishRelease: false) { | ||
publishToMaven( | ||
signingArtifactsPath: "$WORKSPACE/repository/", | ||
mavenArtifactsPath: "$WORKSPACE/repository/", | ||
autoPublish: true | ||
) | ||
} | ||
triggers { | ||
GenericTrigger( | ||
genericVariables: [ | ||
[key: 'ref', value: '$.ref'], | ||
[key: 'VERSION', value: '$.ref', regexpFilter: 'refs/tags/v' ], | ||
], | ||
tokenCredentialId: 'jenkins-sql-jdbc-generic-webhook-token', | ||
causeString: 'A tag was cut on opensearch-project/sql repository causing this workflow to run', | ||
printContributedVariables: false, | ||
printPostContent: false, | ||
regexpFilterText: '$ref', | ||
regexpFilterExpression: '^sql-jdbc-release-[0-9\.]*$' | ||
) | ||
} | ||
environment { | ||
ARTIFACT_PATH = "$WORKSPACE/build/repository/org/opensearch/driver/opensearch-sql-jdbc/$VERSION" | ||
} | ||
stages { | ||
stage('Publish to Maven Local') { | ||
steps { | ||
// checkout the commit | ||
checkout([ | ||
$class: 'GitSCM', userRemoteConfigs: [[url: 'https://github.com/opensearch-project/sql.git']], | ||
branches: [[name: "$ref"]] | ||
]) | ||
|
||
dir('sql-jdbc') { | ||
// publish maven artifacts | ||
sh('./gradlew --no-daemon publishPublishMavenPublicationToLocalRepoRepository') | ||
} | ||
} | ||
} | ||
stage('Sign') { | ||
steps { | ||
script { | ||
signArtifacts( | ||
artifactPath: "${ARTIFACT_PATH}", | ||
type: 'maven', | ||
platform: 'linux' | ||
) | ||
} | ||
} | ||
} | ||
stage('Stage Maven Artifacts') { | ||
environment { | ||
REPO_URL = 'https://aws.oss.sonatype.org/' | ||
STAGING_PROFILE_ID = "${SONATYPE_STAGING_PROFILE_ID}" | ||
BUILD_ID = "${BUILD_NUMBER}" | ||
} | ||
steps { | ||
// checkout the build repo | ||
git url: 'https://github.com/opensearch-project/opensearch-build.git', branch: 'main' | ||
|
||
// stage artifacts for release with Sonatype | ||
withCredentials([usernamePassword(credentialsId: 'jenkins-sonatype-creds', usernameVariable: 'SONATYPE_USERNAME', passwordVariable: 'SONATYPE_PASSWORD')]) { | ||
sh('$WORKSPACE/publish/stage-maven-release.sh $WORKSPACE/build/repository/') | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
cleanWs disableDeferredWipeout: true, deleteDirs: true | ||
} | ||
} | ||
} | ||
} |
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
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