Skip to content

Commit cd6df07

Browse files
cliu123vrozov
authored andcommitted
Build OpenSearch in CD workflow in order to build security plugin (#1364)
(cherry picked from commit 9f04635)
1 parent 2e21d59 commit cd6df07

File tree

1 file changed

+13
-42
lines changed

1 file changed

+13
-42
lines changed

.github/workflows/cd.yml

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ jobs:
1111

1212
steps:
1313

14-
- name: Set up JDK 11
14+
- name: Set up JDK 14
1515
uses: actions/setup-java@v1
1616
with:
17-
java-version: 11.0.x
18-
server-id: sonatype-nexus-staging
19-
server-username: SONATYPE_USER
20-
server-password: SONATYPE_PASSWORD
17+
java-version: 14.0.x
2118

2219
- name: Checkout security
2320
uses: actions/checkout@v2
@@ -29,6 +26,17 @@ jobs:
2926
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3027
restore-keys: ${{ runner.os }}-m2
3128

29+
- name: Checkout OpenSearch
30+
uses: actions/checkout@v2
31+
with:
32+
repository: 'opensearch-project/OpenSearch'
33+
path: OpenSearch
34+
ref: '1.0'
35+
36+
- name: Build OpenSearch
37+
working-directory: ./OpenSearch
38+
run: ./gradlew publishToMavenLocal -Dbuild.snapshot=false
39+
3240
- name: Build
3341
run: |
3442
mvn -B clean package -Padvanced -DskipTests
@@ -41,43 +49,6 @@ jobs:
4149
zip -r artifacts.zip artifacts
4250
echo "TAG_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
4351
44-
- name: Configure AWS Credentials
45-
uses: aws-actions/configure-aws-credentials@v1
46-
with:
47-
aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }}
48-
aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }}
49-
aws-region: us-west-2
50-
51-
- name: Upload Artifacts to S3
52-
run: |
53-
zip=`ls artifacts/*.zip`
54-
rpm=`ls artifacts/*.rpm`
55-
deb=`ls artifacts/*.deb`
56-
57-
# Inject the build number before the suffix
58-
zip_outfile=`basename ${zip%.zip}-build-${GITHUB_RUN_NUMBER}.zip`
59-
rpm_outfile=`basename ${rpm%.rpm}-build-${GITHUB_RUN_NUMBER}.rpm`
60-
deb_outfile=`basename ${deb%.deb}-build-${GITHUB_RUN_NUMBER}.deb`
61-
62-
s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-plugins/security/"
63-
64-
echo "Copying ${zip} to ${s3_prefix}${zip_outfile}"
65-
aws s3 cp --quiet $zip ${s3_prefix}${zip_outfile}
66-
67-
echo "Copying ${rpm} to ${s3_prefix}${rpm_outfile}"
68-
aws s3 cp --quiet $rpm ${s3_prefix}${rpm_outfile}
69-
70-
echo "Copying ${deb} to ${s3_prefix}${deb_outfile}"
71-
aws s3 cp --quiet $deb ${s3_prefix}${deb_outfile}
72-
73-
- name: Upload Artifacts to Maven Central
74-
env:
75-
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
76-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
77-
run: |
78-
gpg --batch --import --no-tty <(echo -e "${{ secrets.PGP_PRIVATE_KEY }}")
79-
mvn -B deploy -Padvanced -Prelease -DskipTests -Dgpg.passphrase=${{ secrets.PGP_PASSPHRASE }}
80-
8152
- name: Create Github Draft Release
8253
id: create_release
8354
uses: actions/[email protected]

0 commit comments

Comments
 (0)