Skip to content

Commit a60d768

Browse files
Onboarding new maven snapshots publishing to s3 (observabillity) (#1953)
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent ccfee9e commit a60d768

File tree

2 files changed

+15
-10
lines changed

2 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: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ buildscript {
2727

2828
repositories {
2929
mavenLocal()
30-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
31-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
30+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
3231
mavenCentral()
3332
maven { url "https://plugins.gradle.org/m2/" }
3433
}
@@ -96,10 +95,11 @@ publishing {
9695
repositories {
9796
maven {
9897
name = "Snapshots" // optional target repository name
99-
url = "https://central.sonatype.com/repository/maven-snapshots/"
100-
credentials {
101-
username "$System.env.SONATYPE_USERNAME"
102-
password "$System.env.SONATYPE_PASSWORD"
98+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
99+
credentials(AwsCredentials) {
100+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
101+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
102+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
103103
}
104104
}
105105
}
@@ -147,8 +147,7 @@ configurations.all {
147147

148148
repositories {
149149
mavenLocal()
150-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
151-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
150+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
152151
mavenCentral()
153152
maven { url "https://plugins.gradle.org/m2/" }
154153
}

0 commit comments

Comments
 (0)