Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install logstash plugins at build-time #12640

Merged
merged 23 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions logstash-filter-xml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#
# WARNING: Due to the way logstash loads plugins we have to load this package
# at build time. That means the logstash package must be rebuilt to
# pick up changes from this package. Simply building and publishing
# a new version of this package is not enough to land changes.
#
# tl;dr: If you're touching this package please also rebuild logstash!!
#
package:
name: logstash-filter-xml
version: 4.2.0
epoch: 0
description: Logstash - transport and process your logs, events, or other data
copyright:
- license: Apache-2.0

environment:
contents:
packages:
- bash
- busybox
- ca-certificates-bundle
- jruby-9.4
- jruby-9.4-default-ruby
- openjdk-17
- openjdk-17-default-jvm
environment:
JAVA_HOME: /usr/lib/jvm/default-jvm

vars:
gem: logstash-filter-xml

# Do not run ruby/clean as logstash needs the cached gem file to install
pipeline:
- uses: git-checkout
with:
repository: https://github.com/logstash-plugins/logstash-filter-xml.git
tag: v${{package.version}}
expected-commit: e947ec5b08e8b25ee35aba1bb0bcd070b1454dae
- runs: |
# Fix GHSA-xc9x-jj77-9p9j
sed -i "s/'nokogiri', '>= 1.13.8'/'nokogiri', '>= 1.16.2'/" "${{package.name}}.gemspec"
- uses: ruby/build
with:
gem: ${{vars.gem}}
- uses: ruby/install
with:
gem: ${{vars.gem}}
version: ${{package.version}}

test:
environment:
contents:
packages:
- wolfi-base
- logstash
- openjdk-17-default-jvm
pipeline:
- runs: |
logstash-plugin install $(find / -type f -name "${{package.name}}-*.gem")
logstash-plugin list | grep ${{package.name}}

update:
enabled: true
github:
identifier: logstash-plugins/logstash-filter-xml
use-tag: true
strip-prefix: v
45 changes: 28 additions & 17 deletions logstash-integration-jdbc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#
# WARNING: Due to the way logstash loads plugins we have to load this package
# at build time. That means the logstash package must be rebuilt to
# pick up changes from this package. Simply building and publishing
# a new version of this package is not enough to land changes.
#
# tl;dr: If you're touching this package please also rebuild logstash!!
#
package:
name: logstash-integration-jdbc
version: 5.4.8
Expand All @@ -12,44 +20,47 @@ environment:
- build-base
- busybox
- ca-certificates-bundle
- openjdk-11
- openjdk-11-default-jvm
- ruby-3.2
- jruby-9.4
- jruby-9.4-default-ruby
- openjdk-17
- openjdk-17-default-jvm

# Do not run ruby/clean as logstash needs the cached gem file to install
pipeline:
- uses: git-checkout
with:
repository: https://github.com/logstash-plugins/logstash-integration-jdbc
tag: v${{package.version}}
expected-commit: 68ec2357b7007d753ba0e77f253e6c5941854889

# update the derby version to mitigate the CVE-2018-1313
- runs: sed -i "s/def DERBY_VERSION = '10.14.1.0'/def DERBY_VERSION = '10.14.2.0'/g" build.gradle

- runs: |
# Extract the Ruby version
ruby_version=$(ruby -e 'puts RUBY_VERSION')
dest="${{targets.destdir}}/usr/share/java/logstash/vendor/bundle/jruby/${ruby_version}/gems/${{vars.gem}}-${{package.version}}"
mkdir -p "$dest"
# update the derby version to mitigate the CVE-2018-1313
sed -i "s/def DERBY_VERSION = '10.14.1.0'/def DERBY_VERSION = '10.14.2.0'/g" build.gradle

./gradlew vendor
mv vendor "$dest"

- uses: ruby/build
with:
gem: ${{vars.gem}}

- uses: ruby/install
with:
gem: ${{vars.gem}}
gem-file: ${{vars.gem}}.gemspec
version: ${{package.version}}

- uses: ruby/clean

vars:
gem: logstash-integration-jdbc

test:
environment:
contents:
packages:
- wolfi-base
- logstash
- openjdk-11-default-jvm
- jruby-9.4
pipeline:
- runs: |
logstash-plugin install $(find / -type f -name "${{package.name}}-*.gem")
logstash-plugin list | grep ${{package.name}}

update:
enabled: true
github:
Expand Down
67 changes: 67 additions & 0 deletions logstash-output-opensearch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
# WARNING: Due to the way logstash loads plugins we have to load this package
# at build time. That means the logstash package must be rebuilt to
# pick up changes from this package. Simply building and publishing
# a new version of this package is not enough to land changes.
#
# tl;dr: If you're touching this package please also rebuild logstash!!
#
package:
name: logstash-output-opensearch
version: 2.0.2
epoch: 0
description: Logstash - transport and process your logs, events, or other data
copyright:
- license: Apache-2.0

environment:
contents:
packages:
- bash
- busybox
- ca-certificates-bundle
- jruby-9.4
- jruby-9.4-default-ruby
- openjdk-17
- openjdk-17-default-jvm
environment:
JAVA_HOME: /usr/lib/jvm/default-jvm

vars:
gem: logstash-output-opensearch

# Do not run ruby/clean as logstash needs the cached gem file to install
pipeline:
- uses: git-checkout
with:
repository: https://github.com/opensearch-project/logstash-output-opensearch
tag: ${{package.version}}
expected-commit: 844fb28d9e148e4042563d277b8e4c8a63392f81
- uses: ruby/build
with:
gem: ${{vars.gem}}
- runs: |
# Get rid of the `-VERSION-ARCH-OS` suffix from the gem file name.
mv ${{vars.gem}}-*.gem ${{vars.gem}}-${{package.version}}.gem
- uses: ruby/install
with:
gem: ${{vars.gem}}
version: ${{package.version}}

test:
environment:
contents:
packages:
- wolfi-base
- logstash
- openjdk-17-default-jvm
pipeline:
- runs: |
logstash-plugin install $(find / -type f -name "${{package.name}}-*.gem")
logstash-plugin list | grep ${{package.name}}

update:
enabled: true
github:
identifier: opensearch-project/logstash-output-opensearch
use-tag: true
Loading
Loading