Skip to content

Commit 12757cf

Browse files
Onboarding new maven snapshots publishing to s3 (UBI)
Signed-off-by: Peter Zhu <[email protected]>
1 parent 575cb83 commit 12757cf

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
@@ -31,8 +31,14 @@ jobs:
3131
export-env: true
3232
env:
3333
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
34-
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
35-
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
34+
MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo
35+
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role
36+
37+
- name: Configure AWS credentials
38+
uses: aws-actions/configure-aws-credentials@v5
39+
with:
40+
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
41+
aws-region: us-east-1
3642

3743
- name: Publish snapshots to maven
3844
run: |

build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ buildscript {
5454

5555
repositories {
5656
mavenLocal()
57-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
58-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
57+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
5958
mavenCentral()
6059
maven { url "https://plugins.gradle.org/m2/" }
6160
maven { url 'https://jitpack.io' }
@@ -69,8 +68,7 @@ buildscript {
6968

7069
repositories {
7170
mavenLocal()
72-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
73-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
71+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
7472
mavenCentral()
7573
maven { url "https://plugins.gradle.org/m2/" }
7674
}
@@ -127,10 +125,11 @@ publishing {
127125
repositories {
128126
maven {
129127
name = "Snapshots"
130-
url = "https://central.sonatype.com/repository/maven-snapshots/"
131-
credentials {
132-
username System.getenv("SONATYPE_USERNAME")
133-
password System.getenv("SONATYPE_PASSWORD")
128+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
129+
credentials(AwsCredentials) {
130+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
131+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
132+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
134133
}
135134
}
136135
maven {

0 commit comments

Comments
 (0)