Skip to content

Commit 3a17574

Browse files
* Onboard to s3 snapshots * Remove oss sonatype maven reference --------- (cherry picked from commit 3950a87) Signed-off-by: Darshit Chanpura <[email protected]> Co-authored-by: Darshit Chanpura <[email protected]>
1 parent b9765b0 commit 3a17574

File tree

7 files changed

+31
-24
lines changed

7 files changed

+31
-24
lines changed

.github/workflows/maven-publish.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ jobs:
3333
export-env: true
3434
env:
3535
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
36-
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
37-
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
36+
MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo
37+
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role
38+
39+
- name: Configure AWS credentials
40+
uses: aws-actions/configure-aws-credentials@v5
41+
with:
42+
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
43+
aws-region: us-east-1
3844

3945
- name: publish snapshots to maven
4046
run: |

build-tools/repositories.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
repositories {
77
mavenLocal()
8-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
9-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
8+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
109
mavenCentral()
1110
maven {url 'https://oss.sonatype.org/content/repositories/snapshots/'}
1211
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/lucene/" }

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ buildscript {
3131

3232
repositories {
3333
mavenLocal()
34-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
35-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
34+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
3635
mavenCentral()
3736
maven { url "https://plugins.gradle.org/m2/" }
3837
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/lucene/" }

client/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ publishing {
8282
}
8383
maven {
8484
name = "Snapshots"
85-
url = "https://central.sonatype.com/repository/maven-snapshots/"
86-
credentials {
87-
username "$System.env.SONATYPE_USERNAME"
88-
password "$System.env.SONATYPE_PASSWORD"
85+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
86+
credentials(AwsCredentials) {
87+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
88+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
89+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
8990
}
9091
}
9192
}

common/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ publishing {
117117
}
118118
maven {
119119
name = "Snapshots" // optional target repository name
120-
url = "https://central.sonatype.com/repository/maven-snapshots/"
121-
credentials {
122-
username "$System.env.SONATYPE_USERNAME"
123-
password "$System.env.SONATYPE_PASSWORD"
120+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
121+
credentials(AwsCredentials) {
122+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
123+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
124+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
124125
}
125126
}
126127
}

plugin/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,11 @@ publishing {
128128
mavenCentral()
129129
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/lucene/" }
130130
name = "Snapshots"
131-
url = "https://central.sonatype.com/repository/maven-snapshots/"
132-
credentials {
133-
username "$System.env.SONATYPE_USERNAME"
134-
password "$System.env.SONATYPE_PASSWORD"
131+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
132+
credentials(AwsCredentials) {
133+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
134+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
135+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
135136
}
136137
}
137138
}

spi/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ apply plugin: 'opensearch.java'
1818
repositories {
1919
mavenLocal()
2020
mavenCentral()
21-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
22-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
21+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
2322
}
2423

2524
ext {
@@ -97,10 +96,11 @@ publishing {
9796
}
9897
maven {
9998
name = "Snapshots" // optional target repository name
100-
url = "https://central.sonatype.com/repository/maven-snapshots/"
101-
credentials {
102-
username "$System.env.SONATYPE_USERNAME"
103-
password "$System.env.SONATYPE_PASSWORD"
99+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
100+
credentials(AwsCredentials) {
101+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
102+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
103+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
104104
}
105105
}
106106
}

0 commit comments

Comments
 (0)