Skip to content

Commit 42c0878

Browse files
Onboarding new maven snapshots publishing to s3 (alerting) (#1949)
Signed-off-by: Peter Zhu <[email protected]>
1 parent b87b2dd commit 42c0878

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed

.github/workflows/maven-publish.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ jobs:
3535
export-env: true
3636
env:
3737
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
38-
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
39-
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
38+
MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo
39+
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role
40+
- name: Configure AWS credentials
41+
uses: aws-actions/configure-aws-credentials@v5
42+
with:
43+
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
44+
aws-region: us-east-1
4045
- name: publish snapshots to maven
4146
run: |
4247
./gradlew publishShadowPublicationToSnapshotsRepository

alerting/build.gradle

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

build-tools/repositories.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
repositories {
77
mavenLocal()
8-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
8+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
99
mavenCentral()
1010
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ buildscript {
2929
repositories {
3030
mavenLocal()
3131
maven {
32-
url "https://central.sonatype.com/repository/maven-snapshots/"
32+
url "https://ci.opensearch.org/ci/dbc/snapshots/maven/"
3333
mavenContent {
3434
snapshotsOnly()
3535
}

sample-remote-monitor-plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ext {
3030
repositories {
3131
mavenLocal()
3232
mavenCentral()
33-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
33+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
3434
}
3535

3636
configurations {

spi/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ publishing {
4444
}
4545
maven {
4646
name = "Snapshots"
47-
url = "https://central.sonatype.com/repository/maven-snapshots/"
48-
credentials {
49-
username System.getenv("SONATYPE_USERNAME")
50-
password System.getenv("SONATYPE_PASSWORD")
47+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
48+
credentials(AwsCredentials) {
49+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
50+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
51+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
5152
}
5253
}
5354
}

0 commit comments

Comments
 (0)