Skip to content

Commit 1d8117c

Browse files
authored
Merge pull request #39 from kaisecheng/remove-ruby-execution-engine
remove logstash/pipeline upstream: #12490
2 parents 8cfbcdb + 3016567 commit 1d8117c

File tree

6 files changed

+36
-27
lines changed

6 files changed

+36
-27
lines changed

.ci/common/logstash.Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
ARG ELASTIC_STACK_VERSION
22
FROM docker.elastic.co/logstash/logstash:$ELASTIC_STACK_VERSION
3-
COPY --chown=logstash:logstash Gemfile /usr/share/plugins/plugin/
4-
COPY --chown=logstash:logstash *.gemspec /usr/share/plugins/plugin/
3+
USER logstash
4+
COPY --chown=logstash:logstash Gemfile /usr/share/plugins/plugin/Gemfile
5+
COPY --chown=logstash:logstash *.gemspec VERSION* version* /usr/share/plugins/plugin/
56
RUN cp /usr/share/logstash/logstash-core/versions-gem-copy.yml /usr/share/logstash/versions.yml
6-
ENV PATH="${PATH}:/usr/share/logstash/vendor/jruby/bin"
7+
# NOTE: since 7.10 JDK is bundled as part of the LS distribution under $LS_HOME/jdk
8+
ENV PATH="${PATH}:/usr/share/logstash/vendor/jruby/bin:/usr/share/logstash/jdk/bin"
79
ENV LOGSTASH_SOURCE="1"
810
RUN gem install bundler -v '< 2'
911
WORKDIR /usr/share/plugins/plugin

.ci/docker-setup.sh

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,56 +8,60 @@
88
# - INTEGRATION: (optional) a value of "true" changes the default value of $TEST_MODE to "integration"
99
set -e
1010

11+
pull_docker_snapshot() {
12+
project="${1?project name required}"
13+
local docker_image="docker.elastic.co/${project}/${project}${DISTRIBUTION_SUFFIX}:${ELASTIC_STACK_VERSION}"
14+
echo "Pulling $docker_image"
15+
docker pull "$docker_image"
16+
}
17+
1118
# TEST_MODE should be one of "unit" or "integration" (defaults to "unit" unless INTEGRATION=true)
1219
: "${TEST_MODE:=$([[ "${INTEGRATION}" = "true" ]] && echo "integration" || echo "unit")}"
1320
export TEST_MODE
1421

15-
VERSION_URL="https://raw.githubusercontent.com/elastic/logstash/master/ci/logstash_releases.json"
22+
VERSION_URL="https://raw.githubusercontent.com/elastic/logstash/master/ci/logstash_releases.json"
1623

17-
if [ -z "${ELASTIC_STACK_VERSION}" ]; then
24+
if [ -z "${ELASTIC_STACK_VERSION}" ]; then
1825
echo "Please set the ELASTIC_STACK_VERSION environment variable"
19-
echo "For example: export ELASTIC_STACK_VERSION=6.2.4"
26+
echo "For example: export ELASTIC_STACK_VERSION=7.x"
2027
exit 1
2128
fi
2229

23-
echo "Fetching versions from $VERSION_URL"
30+
echo "Fetching versions from $VERSION_URL"
2431
VERSIONS=$(curl $VERSION_URL)
2532

26-
if [[ "$SNAPSHOT" = "true" ]]; then
33+
if [[ "$SNAPSHOT" = "true" ]]; then
2734
ELASTIC_STACK_RETRIEVED_VERSION=$(echo $VERSIONS | jq '.snapshots."'"$ELASTIC_STACK_VERSION"'"')
2835
echo $ELASTIC_STACK_RETRIEVED_VERSION
2936
else
3037
ELASTIC_STACK_RETRIEVED_VERSION=$(echo $VERSIONS | jq '.releases."'"$ELASTIC_STACK_VERSION"'"')
3138
fi
3239

33-
if [[ "$ELASTIC_STACK_RETRIEVED_VERSION" != "null" ]]; then
40+
if [[ "$ELASTIC_STACK_RETRIEVED_VERSION" != "null" ]]; then
3441
# remove starting and trailing double quotes
3542
ELASTIC_STACK_RETRIEVED_VERSION="${ELASTIC_STACK_RETRIEVED_VERSION%\"}"
3643
ELASTIC_STACK_RETRIEVED_VERSION="${ELASTIC_STACK_RETRIEVED_VERSION#\"}"
3744
echo "Translated $ELASTIC_STACK_VERSION to ${ELASTIC_STACK_RETRIEVED_VERSION}"
3845
export ELASTIC_STACK_VERSION=$ELASTIC_STACK_RETRIEVED_VERSION
3946
fi
4047

41-
echo "Testing against version: $ELASTIC_STACK_VERSION"
42-
43-
if [[ "$ELASTIC_STACK_VERSION" = *"-SNAPSHOT" ]]; then
44-
cd /tmp
45-
46-
jq=".build.projects.logstash.packages.\"logstash-$ELASTIC_STACK_VERSION-docker-image.tar.gz\".url"
47-
result=$(curl --silent https://artifacts-api.elastic.co/v1/versions/$ELASTIC_STACK_VERSION/builds/latest | jq -r $jq)
48-
echo $result
49-
curl $result > logstash-docker-image.tar.gz
50-
tar xfvz logstash-docker-image.tar.gz repositories
51-
echo "Loading docker image: "
52-
cat repositories
53-
docker load < logstash-docker-image.tar.gz
54-
rm logstash-docker-image.tar.gz
55-
cd -
48+
case "${DISTRIBUTION}" in
49+
default) DISTRIBUTION_SUFFIX="" ;; # empty string when explicit "default" is given
50+
*) DISTRIBUTION_SUFFIX="${DISTRIBUTION/*/-}${DISTRIBUTION}" ;;
51+
esac
52+
export DISTRIBUTION_SUFFIX
53+
54+
echo "Testing against version: $ELASTIC_STACK_VERSION (distribution: ${DISTRIBUTION:-"default"})"
55+
56+
if [[ "$ELASTIC_STACK_VERSION" = *"-SNAPSHOT" ]]; then
57+
pull_docker_snapshot "logstash"
5658
fi
5759

58-
if [ -f Gemfile.lock ]; then
60+
if [ -f Gemfile.lock ]; then
5961
rm Gemfile.lock
6062
fi
6163

64+
CURRENT_DIR=$(dirname "${BASH_SOURCE[0]}")
65+
6266
docker-compose --file ".ci/common/docker-compose.yml" --file ".ci/${TEST_MODE}/docker-compose.override.yml" down
6367
docker-compose --file ".ci/common/docker-compose.yml" --file ".ci/${TEST_MODE}/docker-compose.override.yml" --verbose build

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 7.2.0
2+
- Remove ruby pipeline dependency. Starting from Logstash 8, Ruby execution engine is not available. All pipelines should use Java pipeline [#39](https://github.com/logstash-plugins/logstash-integration-rabbitmq/pull/39)
3+
14
## 7.1.1
25
- DOC:Replaced plugin_header file with plugin_header-integration file. ([#34](https://github.com/logstash-plugins/logstash-integration-rabbitmq/issues/34))
36

lib/logstash/plugin_mixins/rabbitmq_connection.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require "logstash/namespace"
33
require "march_hare"
44
require "java"
5+
require "stud/interval"
56

67
# Common functionality for the rabbitmq input/output
78
module LogStash

logstash-integration-rabbitmq.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'logstash-integration-rabbitmq'
3-
s.version = '7.1.1'
3+
s.version = '7.2.0'
44
s.licenses = ['Apache License (2.0)']
55
s.summary = "Integration with RabbitMQ - input and output plugins"
66
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline "+

spec/outputs/rabbitmq_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# encoding: UTF-8
22
require "logstash/devutils/rspec/spec_helper"
3-
require "logstash/pipeline"
43
require "logstash/outputs/rabbitmq"
54

65
describe LogStash::Outputs::RabbitMQ do

0 commit comments

Comments
 (0)