Skip to content

Commit 4d1c695

Browse files
opensearch-trigger-bot[bot]DarshitChanpuragaiksaya
authored
Onboard to s3 snapshots (#4320) (#4322)
* Onboard to s3 snapshots * Remove oss sonatype maven reference --------- (cherry picked from commit 3950a87) Signed-off-by: Darshit Chanpura <dchanp@amazon.com> Co-authored-by: Darshit Chanpura <dchanp@amazon.com> Co-authored-by: Sayali Gaikawad <gaiksaya@amazon.com>
1 parent 9e5b341 commit 4d1c695

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
@@ -30,8 +30,7 @@ buildscript {
3030

3131
repositories {
3232
mavenLocal()
33-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
34-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
33+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
3534
mavenCentral()
3635
maven { url "https://plugins.gradle.org/m2/" }
3736
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
@@ -81,10 +81,11 @@ publishing {
8181
}
8282
maven {
8383
name = "Snapshots"
84-
url = "https://central.sonatype.com/repository/maven-snapshots/"
85-
credentials {
86-
username "$System.env.SONATYPE_USERNAME"
87-
password "$System.env.SONATYPE_PASSWORD"
84+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
85+
credentials(AwsCredentials) {
86+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
87+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
88+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
8889
}
8990
}
9091
}

common/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,11 @@ publishing {
121121
}
122122
maven {
123123
name = "Snapshots" // optional target repository name
124-
url = "https://central.sonatype.com/repository/maven-snapshots/"
125-
credentials {
126-
username "$System.env.SONATYPE_USERNAME"
127-
password "$System.env.SONATYPE_PASSWORD"
124+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
125+
credentials(AwsCredentials) {
126+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
127+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
128+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
128129
}
129130
}
130131
}

plugin/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@ publishing {
119119
mavenCentral()
120120
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/lucene/" }
121121
name = "Snapshots"
122-
url = "https://central.sonatype.com/repository/maven-snapshots/"
123-
credentials {
124-
username "$System.env.SONATYPE_USERNAME"
125-
password "$System.env.SONATYPE_PASSWORD"
122+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
123+
credentials(AwsCredentials) {
124+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
125+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
126+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
126127
}
127128
}
128129
}

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)