Skip to content

Commit 3ce94ba

Browse files
Onboarding new maven snapshots publishing to s3 (reporting) (opensearch-project#1132) (opensearch-project#1136)
(cherry picked from commit 2db9dd5) 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 2920d52 commit 3ce94ba

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.github/workflows/maven-publish.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ jobs:
2929
export-env: true
3030
env:
3131
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
32-
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
33-
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
32+
MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo
33+
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role
34+
- name: Configure AWS credentials
35+
uses: aws-actions/configure-aws-credentials@v5
36+
with:
37+
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
38+
aws-region: us-east-1
3439
- name: publish snapshots to maven
3540
run: |
3641
./gradlew publishPluginZipPublicationToSnapshotsRepository

.github/workflows/reports-scheduler-test-and-build-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- name: Upload Artifacts
6565
uses: actions/upload-artifact@v4
6666
with:
67-
name: reports-scheduler-linux
67+
name: reports-scheduler-linux-${{ matrix.java }}
6868
path: reports-scheduler-builds
6969

7070
build-windows-macos:

build.gradle

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ buildscript {
4747

4848
repositories {
4949
mavenLocal()
50-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
51-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
50+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
5251
mavenCentral()
5352
maven { url "https://plugins.gradle.org/m2/" }
5453
}
@@ -117,10 +116,11 @@ publishing {
117116
repositories {
118117
maven {
119118
name = "Snapshots" // optional target repository name
120-
url = "https://central.sonatype.com/repository/maven-snapshots/"
121-
credentials {
122-
username System.getenv("SONATYPE_USERNAME")
123-
password System.getenv("SONATYPE_PASSWORD")
119+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
120+
credentials(AwsCredentials) {
121+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
122+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
123+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
124124
}
125125
}
126126
}
@@ -203,8 +203,7 @@ allprojects {
203203

204204
repositories {
205205
mavenLocal()
206-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
207-
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
206+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
208207
mavenCentral()
209208
maven { url "https://plugins.gradle.org/m2/" }
210209
}
@@ -493,7 +492,7 @@ ext.resolvePluginFile = { pluginId ->
493492
def securityPluginFile = resolvePluginFile("opensearch-security")
494493

495494
testClusters.integTest {
496-
testDistribution = "INTEG_TEST"
495+
testDistribution = "ARCHIVE"
497496
// need to install job-scheduler first, need to assemble job-scheduler first
498497
plugin(provider(new Callable<RegularFile>(){
499498
@Override

0 commit comments

Comments
 (0)