-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build OpenSearch in CD workflow in order to build security plugin (#1364
) (cherry picked from commit 9f04635)
- Loading branch information
Showing
1 changed file
with
13 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,10 @@ jobs: | |
|
||
steps: | ||
|
||
- name: Set up JDK 11 | ||
- name: Set up JDK 14 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11.0.x | ||
server-id: sonatype-nexus-staging | ||
server-username: SONATYPE_USER | ||
server-password: SONATYPE_PASSWORD | ||
java-version: 14.0.x | ||
|
||
- name: Checkout security | ||
uses: actions/checkout@v2 | ||
|
@@ -29,6 +26,17 @@ jobs: | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Checkout OpenSearch | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: 'opensearch-project/OpenSearch' | ||
path: OpenSearch | ||
ref: '1.0' | ||
|
||
- name: Build OpenSearch | ||
working-directory: ./OpenSearch | ||
run: ./gradlew publishToMavenLocal -Dbuild.snapshot=false | ||
|
||
- name: Build | ||
run: | | ||
mvn -B clean package -Padvanced -DskipTests | ||
|
@@ -41,43 +49,6 @@ jobs: | |
zip -r artifacts.zip artifacts | ||
echo "TAG_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-2 | ||
|
||
- name: Upload Artifacts to S3 | ||
run: | | ||
zip=`ls artifacts/*.zip` | ||
rpm=`ls artifacts/*.rpm` | ||
deb=`ls artifacts/*.deb` | ||
# Inject the build number before the suffix | ||
zip_outfile=`basename ${zip%.zip}-build-${GITHUB_RUN_NUMBER}.zip` | ||
rpm_outfile=`basename ${rpm%.rpm}-build-${GITHUB_RUN_NUMBER}.rpm` | ||
deb_outfile=`basename ${deb%.deb}-build-${GITHUB_RUN_NUMBER}.deb` | ||
s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-plugins/security/" | ||
echo "Copying ${zip} to ${s3_prefix}${zip_outfile}" | ||
aws s3 cp --quiet $zip ${s3_prefix}${zip_outfile} | ||
echo "Copying ${rpm} to ${s3_prefix}${rpm_outfile}" | ||
aws s3 cp --quiet $rpm ${s3_prefix}${rpm_outfile} | ||
echo "Copying ${deb} to ${s3_prefix}${deb_outfile}" | ||
aws s3 cp --quiet $deb ${s3_prefix}${deb_outfile} | ||
- name: Upload Artifacts to Maven Central | ||
env: | ||
SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
run: | | ||
gpg --batch --import --no-tty <(echo -e "${{ secrets.PGP_PRIVATE_KEY }}") | ||
mvn -B deploy -Padvanced -Prelease -DskipTests -Dgpg.passphrase=${{ secrets.PGP_PASSPHRASE }} | ||
- name: Create Github Draft Release | ||
id: create_release | ||
uses: actions/[email protected] | ||
|