Skip to content

Commit 0e8de37

Browse files
Signed-off-by: Yury-Fridlyand <[email protected]> Signed-off-by: Yury-Fridlyand <[email protected]>
1 parent 28b8856 commit 0e8de37

File tree

2 files changed

+145
-40
lines changed

2 files changed

+145
-40
lines changed

build.gradle

Lines changed: 53 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222
id 'signing'
2323
}
2424

25-
group 'org.opensearch.client'
25+
group 'org.opensearch.driver'
2626

2727
// keep version in sync with version in Driver source
2828
version '2.0.0.0'
@@ -89,7 +89,7 @@ tasks.withType(JavaCompile) {
8989
}
9090

9191
static def getShadowPath(String path) {
92-
return 'com.amazonaws.opensearch.sql.jdbc.shadow.' + path
92+
return 'org.opensearch.sql.jdbc.shadow.' + path
9393
}
9494

9595
shadowJar {
@@ -107,10 +107,7 @@ shadowJar {
107107
exclude 'META-INF/NOTICE*'
108108
exclude 'META-INF/DEPENDENCIES'
109109

110-
relocate('com.amazonaws', getShadowPath('com.amazonaws')) {
111-
exclude 'com.amazonaws.opensearch.*/**'
112-
}
113-
110+
relocate 'com.amazonaws', getShadowPath('com.amazonaws')
114111
relocate 'org.apache', getShadowPath('org.apache')
115112
relocate 'org.joda', getShadowPath('org.joda')
116113
relocate 'com.fasterxml', getShadowPath('com.fasterxml')
@@ -139,47 +136,59 @@ publishing {
139136
artifact javadocJar
140137

141138
pom {
142-
name = "OpenSearch SQL JDBC Driver"
143-
packaging = "jar"
144-
url = "https://github.com/opensearch-project/sql-jdbc"
145-
description = "OpenSearch SQL JDBC driver"
146-
scm {
147-
connection = "scm:[email protected]:opensearch-project/sql-jdbc.git"
148-
developerConnection = "scm:[email protected]:opensearch-project/sql-jdbc.git"
149-
url = "[email protected]:opensearch-project/sql-jdbc.git"
150-
}
151-
licenses {
152-
license {
153-
name = "The Apache License, Version 2.0"
154-
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
139+
name = "OpenSearch SQL JDBC Driver"
140+
packaging = "jar"
141+
url = "https://github.com/opensearch-project/sql/sql-jdbc"
142+
description = "OpenSearch SQL JDBC driver"
143+
scm {
144+
connection = "scm:[email protected]:opensearch-project/sql.git"
145+
developerConnection = "scm:[email protected]:opensearch-project/sql.git"
146+
url = "[email protected]:opensearch-project/sql.git"
147+
}
148+
licenses {
149+
license {
150+
name = "The Apache License, Version 2.0"
151+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
152+
}
155153
}
156-
}
157-
developers {
158-
developer {
159-
id = "amazonwebservices"
160-
organization = "Amazon Web Services"
161-
organizationUrl = "https://aws.amazon.com"
154+
developers {
155+
developer {
156+
name = 'OpenSearch'
157+
url = 'https://github.com/opensearch-project/sql'
158+
}
162159
}
163-
}
164160
}
165161
}
166-
}
162+
publishMaven(MavenPublication) { publication ->
163+
from components.java
167164

168-
repositories {
169-
maven {
170-
name = "internal-snapshots"
171-
url = "s3://snapshots.opendistroforelasticsearch.amazon.com/maven"
172-
authentication {
173-
awsIm(AwsImAuthentication) // load from EC2 role or env var
174-
}
175-
}
176-
maven {
177-
name = "internal-releases"
178-
url = "s3://artifacts.opendistroforelasticsearch.amazon.com/maven"
179-
authentication {
180-
awsIm(AwsImAuthentication) // load from EC2 role or env var
165+
pom {
166+
name = "OpenSearch SQL JDBC Driver"
167+
packaging = "jar"
168+
url = "https://github.com/opensearch-project/sql/sql-jdbc"
169+
description = "OpenSearch SQL JDBC driver"
170+
scm {
171+
connection = "scm:[email protected]:opensearch-project/sql.git"
172+
developerConnection = "scm:[email protected]:opensearch-project/sql.git"
173+
url = "[email protected]:opensearch-project/sql.git"
174+
}
175+
licenses {
176+
license {
177+
name = "The Apache License, Version 2.0"
178+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
179+
}
180+
}
181+
developers {
182+
developer {
183+
name = 'OpenSearch'
184+
url = 'https://github.com/opensearch-project/sql'
185+
}
186+
}
181187
}
182188
}
189+
}
190+
191+
repositories {
183192
maven {
184193
name = "sonatype-staging"
185194
url "https://aws.oss.sonatype.org/service/local/staging/deploy/maven2"
@@ -188,6 +197,10 @@ publishing {
188197
password project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
189198
}
190199
}
200+
maven {
201+
name = "localRepo"
202+
url "${project.buildDir}/repository"
203+
}
191204
}
192205

193206
// TODO - enabled debug logging for the time being, remove this eventually
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
lib = library(identifier: 'jenkins@main', retriever: modernSCM([
2+
$class: 'GitSCMSource',
3+
remote: 'https://github.com/opensearch-project/opensearch-build.git',
4+
]))
5+
6+
pipeline {
7+
agent {
8+
docker {
9+
label 'Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host'
10+
image 'opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v2'
11+
args '-e JAVA_HOME=/opt/java/openjdk-11'
12+
alwaysPull true
13+
}
14+
}
15+
options {
16+
timeout(time: 30, unit: 'MINUTES')
17+
throttleJobProperty(
18+
categories: [],
19+
limitOneJobWithMatchingParams: false,
20+
maxConcurrentPerNode: 0,
21+
maxConcurrentTotal: 1,
22+
paramsToUseForLimit: '',
23+
throttleEnabled: true,
24+
throttleOption: 'project',
25+
)
26+
}
27+
triggers {
28+
GenericTrigger(
29+
genericVariables: [
30+
[key: 'ref', value: '$.ref'],
31+
[key: 'VERSION', value: '$.ref', regexpFilter: 'refs/tags/v' ],
32+
],
33+
tokenCredentialId: 'jenkins-sql-jdbc-generic-webhook-token',
34+
causeString: 'A tag was cut on opensearch-project/sql repository causing this workflow to run',
35+
printContributedVariables: false,
36+
printPostContent: false,
37+
regexpFilterText: '$ref',
38+
regexpFilterExpression: '^sql-jdbc-release-[0-9\.]*$'
39+
)
40+
}
41+
environment {
42+
ARTIFACT_PATH = "$WORKSPACE/build/repository/org/opensearch/driver/opensearch-sql-jdbc/$VERSION"
43+
}
44+
stages {
45+
stage('Publish to Maven Local') {
46+
steps {
47+
// checkout the commit
48+
checkout([
49+
$class: 'GitSCM', userRemoteConfigs: [[url: 'https://github.com/opensearch-project/sql.git']],
50+
branches: [[name: "$ref"]]
51+
])
52+
53+
dir('sql-jdbc') {
54+
// publish maven artifacts
55+
sh('./gradlew --no-daemon publishPublishMavenPublicationToLocalRepoRepository')
56+
}
57+
}
58+
}
59+
stage('Sign') {
60+
steps {
61+
script {
62+
signArtifacts(
63+
artifactPath: "${ARTIFACT_PATH}",
64+
type: 'maven',
65+
platform: 'linux'
66+
)
67+
}
68+
}
69+
}
70+
stage('Stage Maven Artifacts') {
71+
environment {
72+
REPO_URL = 'https://aws.oss.sonatype.org/'
73+
STAGING_PROFILE_ID = "${SONATYPE_STAGING_PROFILE_ID}"
74+
BUILD_ID = "${BUILD_NUMBER}"
75+
}
76+
steps {
77+
// checkout the build repo
78+
git url: 'https://github.com/opensearch-project/opensearch-build.git', branch: 'main'
79+
80+
// stage artifacts for release with Sonatype
81+
withCredentials([usernamePassword(credentialsId: 'jenkins-sonatype-creds', usernameVariable: 'SONATYPE_USERNAME', passwordVariable: 'SONATYPE_PASSWORD')]) {
82+
sh('$WORKSPACE/publish/stage-maven-release.sh $WORKSPACE/build/repository/')
83+
}
84+
}
85+
}
86+
}
87+
post {
88+
always {
89+
cleanWs disableDeferredWipeout: true, deleteDirs: true
90+
}
91+
}
92+
}

0 commit comments

Comments
 (0)