-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update es-restlog for ES 7.x and migrate to bazel build (#4)
* Migrate to bazel build * Add build and test actions * Add manual release workflow
- Loading branch information
Showing
19 changed files
with
1,839 additions
and
169 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
directories: | ||
. | ||
|
||
targets: | ||
//... | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
4.0.0 |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Release plugin | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version' | ||
required: true | ||
|
||
jobs: | ||
bazel: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: mishas/setup-bazelisk-action@v1 | ||
|
||
- name: Version | ||
run: bazel version | ||
|
||
- name: Bazel build | ||
run: bazel build ... | ||
- name: List plugin contents | ||
run: | | ||
FILE=$(bazel aquery 'outputs(".*zip", //src/main/java/com/etsy/elasticsearch/restlog:restlog_plugin_versioned)' 2>/dev/null|grep -oE 'Outputs: .+' | sed 's/Outputs: \[//' | sed 's/\]//' | tr "," "\n") | ||
unzip -l $FILE | ||
CHECKSUM=$(sha256sum $FILE | cut -d " " -f 1 ) | ||
echo "FILE=$FILE" >> $GITHUB_ENV | ||
echo "CHECKSUM=$CHECKSUM" >> $GITHUB_ENV | ||
- name: Bazel test | ||
run: bazel test ... --test_output=streamed | ||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.event.inputs.version }} | ||
name: Release for ${{ github.event.inputs.version }} | ||
body: "sha256sum: ${{ env.CHECKSUM }}" | ||
files: "${{ env.FILE }}" | ||
# fail_on_unmatched_files: true |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Bazel build and test | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
bazel: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: mishas/setup-bazelisk-action@v1 | ||
|
||
- name: Version | ||
run: bazel version | ||
|
||
- name: Bazel build | ||
run: bazel build ... | ||
|
||
- name: List plugin contents | ||
run: | | ||
FILE=$(bazel aquery 'outputs(".*zip", //src/main/java/com/etsy/elasticsearch/restlog:restlog_plugin_versioned)' 2>/dev/null|grep -oE 'Outputs: .+' | sed 's/Outputs: \[//' | sed 's/\]//' | tr "," "\n") | ||
unzip -l $FILE | ||
- name: Bazel test | ||
run: bazel test ... --test_output=streamed |
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 |
---|---|---|
@@ -1,8 +1,34 @@ | ||
target/ | ||
|
||
# gah macs | ||
.DS_Store | ||
|
||
# intellij | ||
.idea/ | ||
# intellij user-specific stuff | ||
.idea/workspace.xml | ||
.idea/tasks.xml | ||
.idea/dictionaries | ||
.idea/saveactions_settings.xml | ||
.idea/compiler.xml | ||
.idea/sshConfigs.xml | ||
|
||
# IntellJ IDEA Bazel plugin settings | ||
.ijwb | ||
|
||
# managed by gradle's intellij (or is it intellij's gradle) plugin | ||
.idea/libraries | ||
|
||
# intellij high-churn | ||
.idea/deployment.xml | ||
.idea/uiDesigner.xml | ||
.idea/inspectionProfiles | ||
.idea/webServers.xml | ||
.idea/modules.xml | ||
.idea/misc.xml | ||
.idea/codeStyles/ | ||
|
||
*.iml | ||
|
||
# See: https://docs.bazel.build/versions/master/best-practices.html#bazelrc | ||
user.bazelrc | ||
bazel- | ||
bazel-* | ||
build/ |
File renamed without changes.
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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
workspace(name = "restlog") | ||
|
||
load("//:version.bzl", "elasticsearch_version") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
RULES_JVM_EXTERNAL_TAG = "6a3bd6a2cf02e96fd5041500bafa3a35731d4981" # master as of 9 Mar 2021 | ||
RULES_JVM_EXTERNAL_SHA = "42712b494220629e3dbd3d0edee1fb675fb41f507695ca80284b53c291a76299" | ||
|
||
http_archive( | ||
name = "rules_jvm_external", | ||
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, | ||
sha256 = RULES_JVM_EXTERNAL_SHA, | ||
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, | ||
) | ||
|
||
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") | ||
|
||
rules_jvm_external_deps() | ||
|
||
load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") | ||
|
||
rules_jvm_external_setup() | ||
|
||
load("@rules_jvm_external//:defs.bzl", "maven_install") | ||
|
||
maven_install( | ||
name = "jvm_deps", | ||
artifacts = [ | ||
"org.elasticsearch:elasticsearch:%s" % elasticsearch_version, | ||
"org.elasticsearch.test:framework:%s" % elasticsearch_version, | ||
"org.elasticsearch.client:elasticsearch-rest-high-level-client:%s" % elasticsearch_version, | ||
'org.apache.logging.log4j:log4j-api:jar:2.11.1', | ||
'org.apache.logging.log4j:log4j-slf4j-impl:jar:2.11.1', | ||
'org.apache.logging.log4j:log4j-core:2.11.1', | ||
'com.google.guava:guava:29.0-jre', | ||
'org.mockito:mockito-core:3.5.13', | ||
'org.mockito:mockito-inline:3.5.13', | ||
'junit:junit:4.12', | ||
], | ||
repositories = [ | ||
"https://repo1.maven.org/maven2", | ||
], | ||
maven_install_json = "@//:jvm_deps_install.json", | ||
# fails if maven_install_json was not regenerated after updating artifacts | ||
fail_if_repin_required = True, | ||
) | ||
|
||
|
||
load("@jvm_deps//:defs.bzl", pinned_jvm_deps_install = "pinned_maven_install") | ||
|
||
pinned_jvm_deps_install() | ||
|
Oops, something went wrong.