Skip to content

Commit 21206c0

Browse files
Onboarding new maven snapshots publishing to s3 (query-insights) (#467) (#471)
(cherry picked from commit 34391ac) Signed-off-by: Peter Zhu <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent c4e8929 commit 21206c0

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
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: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ buildscript {
2525

2626
repositories {
2727
mavenLocal()
28-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
29-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
28+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
3029
mavenCentral()
3130
maven { url "https://plugins.gradle.org/m2/" }
3231
}
@@ -120,10 +119,11 @@ publishing {
120119
repositories {
121120
maven {
122121
name = "Snapshots"
123-
url = "https://central.sonatype.com/repository/maven-snapshots/"
124-
credentials {
125-
username System.getenv("SONATYPE_USERNAME")
126-
password System.getenv("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")
127127
}
128128
}
129129
}
@@ -176,15 +176,14 @@ allprojects {
176176

177177
repositories {
178178
mavenLocal()
179-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
180-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
179+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
181180
mavenCentral()
182181
maven { url "https://plugins.gradle.org/m2/" }
183182
}
184183

185184
ext {
186185
getSecurityPluginDownloadLink = { ->
187-
var repo = "https://central.sonatype.com/repository/maven-snapshots/org/opensearch/plugin/" +
186+
var repo = "https://ci.opensearch.org/ci/dbc/snapshots/maven/org/opensearch/plugin/" +
188187
"opensearch-security/$opensearch_build_snapshot/"
189188
var metadataFile = Paths.get(projectDir.toString(), "build", "maven-metadata.xml").toAbsolutePath().toFile()
190189
download.run {

0 commit comments

Comments
 (0)