Skip to content

Commit a2af79e

Browse files
DarshitChanpuragaiksaya
authored andcommitted
Onboard to s3 snapshots (#1618)
* Onboard to s3 snapshots Signed-off-by: Darshit Chanpura <[email protected]> * Add changelog entry Signed-off-by: Darshit Chanpura <[email protected]> --------- Signed-off-by: Darshit Chanpura <[email protected]> Signed-off-by: Peter Zhu <[email protected]>
1 parent a5b60a6 commit a2af79e

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

.github/workflows/maven-publish.yml

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

3642
- name: publish snapshots to maven
3743
run: |

build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ buildscript {
3333

3434
repositories {
3535
mavenLocal()
36-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
37-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
36+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
3837
mavenCentral()
3938
maven { url "https://plugins.gradle.org/m2/" }
4039
}
@@ -203,10 +202,11 @@ publishing {
203202
repositories {
204203
maven {
205204
name = "Snapshots"
206-
url = "https://central.sonatype.com/repository/maven-snapshots/"
207-
credentials {
208-
username "$System.env.SONATYPE_USERNAME"
209-
password "$System.env.SONATYPE_PASSWORD"
205+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
206+
credentials(AwsCredentials) {
207+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
208+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
209+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
210210
}
211211
}
212212
}

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://plugins.gradle.org/m2/" }
1211
}

0 commit comments

Comments
 (0)