Skip to content

Commit f05a67e

Browse files
authored
Merge pull request #232 from sujithvm/cd
Fix 7.5.2 version in build gradle and add CD workflow
2 parents 007c915 + f7f8740 commit f05a67e

File tree

3 files changed

+78
-2
lines changed

3 files changed

+78
-2
lines changed

.github/workflows/cd.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
14+
- name: Set up JDK 11
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 11.0.x
18+
19+
- name: Checkout security
20+
uses: actions/checkout@v1
21+
22+
- name: Build
23+
run: |
24+
mvn clean package -Padvanced -DskipTests
25+
artifact_zip=`ls $(pwd)/target/releases/opendistro_security-*.zip | grep -v admin-standalone`
26+
./gradlew build buildDeb buildRpm --no-daemon -ParchivePath=$artifact_zip -Dbuild.snapshot=false
27+
mkdir artifacts
28+
cp $artifact_zip artifacts/
29+
cp gradle-build/distributions/*.deb artifacts/
30+
cp gradle-build/distributions/*.rpm artifacts/
31+
zip -r artifacts.zip artifacts
32+
echo ::set-env name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
33+
34+
- name: Configure AWS Credentials
35+
uses: aws-actions/configure-aws-credentials@v1
36+
with:
37+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
38+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
39+
aws-region: us-west-2
40+
41+
- name: Upload Artifacts to S3
42+
run: |
43+
s3_path=s3://artifacts.opendistroforelasticsearch.amazon.com/downloads
44+
aws s3 cp artifacts/*.zip $s3_path/elasticsearch-plugins/opendistro-security/
45+
aws s3 cp artifacts/*.deb $s3_path/debs/opendistro-security/
46+
aws s3 cp artifacts/*.rpm $s3_path/rpms/opendistro-security/
47+
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths '/downloads/*'
48+
49+
- name: Create Github Draft Release
50+
id: create_release
51+
uses: actions/[email protected]
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
tag_name: ${{ github.ref }}
56+
release_name: Release ${{ env.TAG_VERSION }}
57+
draft: true
58+
prerelease: false
59+
60+
- name: Upload Release Asset
61+
id: upload-release-asset
62+
uses: actions/[email protected]
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
with:
66+
upload_url: ${{ steps.create_release.outputs.upload_url }}
67+
asset_name: artifacts.zip
68+
asset_path: artifacts.zip
69+
asset_content_type: application/zip
70+
71+
- name: Upload Workflow Artifacts
72+
uses: actions/upload-artifact@v1
73+
with:
74+
name: artifacts
75+
path: artifacts/

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches:
99
- master
10+
- opendistro-*
1011

1112
jobs:
1213
build:

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
buildDir = 'gradle-build'
88

99
ext {
10-
opendistroVersion = '1.4.0'
10+
opendistroVersion = '1.5.0'
1111
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
1212
}
1313

@@ -39,7 +39,7 @@ ospackage {
3939
fileMode 0644
4040
dirMode 0755
4141

42-
requires('elasticsearch-oss', "7.4.2", EQUAL)
42+
requires('elasticsearch-oss', "7.5.2", EQUAL)
4343
packager = 'Amazon'
4444
vendor = 'Amazon'
4545
os = 'LINUX'

0 commit comments

Comments
 (0)