forked from elastic/elasticsearch
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to centralized travis configuration (elastic#930)
same work as done in the logstash-plugins/logstash-filter-elasticsearch#126 and logstash-plugins/logstash-input-elasticsearch#120. The only difference is that integration tests need to know the exact elasticsearch version being tested (but the input can be "7.x"). This PR modifies the .ci/logstash-run to fetch the version from elasticsearch itself. Co-authored-by: Karol Bucek <kares@users.noreply.github.com>
- Loading branch information
Showing
11 changed files
with
106 additions
and
119 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,23 @@ | ||
ARG ELASTIC_STACK_VERSION | ||
# TODO: refactor this to be implicitly resolved by logstash-plugins/.ci/Dockerfile | ||
ARG DISTRIBUTION_SUFFIX | ||
FROM docker.elastic.co/logstash/logstash$DISTRIBUTION_SUFFIX:$ELASTIC_STACK_VERSION | ||
USER logstash | ||
COPY --chown=logstash:logstash Gemfile /usr/share/plugins/plugin/Gemfile | ||
COPY --chown=logstash:logstash *.gemspec VERSION* version* /usr/share/plugins/plugin/ | ||
RUN cp /usr/share/logstash/logstash-core/versions-gem-copy.yml /usr/share/logstash/versions.yml | ||
ENV PATH="${PATH}:/usr/share/logstash/vendor/jruby/bin" | ||
ENV LOGSTASH_SOURCE="1" | ||
ENV ELASTIC_STACK_VERSION=$ELASTIC_STACK_VERSION | ||
# DISTRIBUTION="default" (by default) or "oss" | ||
ARG DISTRIBUTION | ||
ENV DISTRIBUTION=$DISTRIBUTION | ||
# INTEGRATION="true" while integration testing (false-y by default) | ||
ARG INTEGRATION | ||
ENV INTEGRATION=$INTEGRATION | ||
RUN gem install bundler -v '< 2' | ||
WORKDIR /usr/share/plugins/plugin | ||
RUN bundle install --with test ci | ||
COPY --chown=logstash:logstash . /usr/share/plugins/plugin | ||
RUN bundle exec rake vendor | ||
RUN .ci/setup.sh |
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,21 @@ | ||
ARG ELASTIC_STACK_VERSION | ||
ARG DISTRIBUTION_SUFFIX | ||
FROM docker.elastic.co/elasticsearch/elasticsearch$DISTRIBUTION_SUFFIX:$ELASTIC_STACK_VERSION | ||
|
||
ARG plugin_path=/usr/share/plugins/plugin | ||
ARG es_path=/usr/share/elasticsearch | ||
ARG es_yml=$es_path/config/elasticsearch.yml | ||
ARG SECURE_INTEGRATION | ||
|
||
RUN rm -f $es_path/config/scripts | ||
|
||
COPY --chown=elasticsearch:elasticsearch spec/fixtures/scripts/groovy/* $es_path/config/scripts/ | ||
COPY --chown=elasticsearch:elasticsearch spec/fixtures/test_certs/* $es_path/config/test_certs/ | ||
COPY --chown=elasticsearch:elasticsearch .ci/elasticsearch-run.sh $es_path/ | ||
|
||
RUN if [ "$SECURE_INTEGRATION" = "true" ] ; then echo "xpack.security.http.ssl.enabled: $SECURE_INTEGRATION" >> $es_yml; fi | ||
RUN if [ "$SECURE_INTEGRATION" = "true" ] ; then echo "xpack.security.http.ssl.key: $es_path/config/test_certs/test.key" >> $es_yml; fi | ||
RUN if [ "$SECURE_INTEGRATION" = "true" ] ; then echo "xpack.security.http.ssl.certificate: $es_path/config/test_certs/test.crt" >> $es_yml; fi | ||
RUN if [ "$SECURE_INTEGRATION" = "true" ] ; then echo "xpack.security.http.ssl.certificate_authorities: [ '$es_path/config/test_certs/ca.crt' ]" >> $es_yml; fi | ||
RUN if [ "$SECURE_INTEGRATION" = "true" ] ; then $es_path/bin/elasticsearch-users useradd simpleuser -p abc123 -r superuser; fi | ||
RUN if [ "$SECURE_INTEGRATION" = "true" ] ; then $es_path/bin/elasticsearch-users useradd 'f@ncyuser' -p 'ab%12#' -r superuser; fi |
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,32 @@ | ||
version: '3' | ||
|
||
services: | ||
|
||
logstash: | ||
command: /usr/share/plugins/plugin/.ci/logstash-run.sh | ||
build: | ||
args: | ||
- ELASTIC_STACK_VERSION=$ELASTIC_STACK_VERSION | ||
- DISTRIBUTION=${DISTRIBUTION:-default} | ||
- DISTRIBUTION_SUFFIX=${DISTRIBUTION_SUFFIX} | ||
environment: | ||
- DISTRIBUTION=${DISTRIBUTION:-default} | ||
- DISTRIBUTION_SUFFIX=${DISTRIBUTION_SUFFIX} | ||
- INTEGRATION=${INTEGRATION:-false} | ||
- SECURE_INTEGRATION=${SECURE_INTEGRATION:-false} | ||
|
||
elasticsearch: | ||
build: | ||
context: ../ | ||
dockerfile: .ci/Dockerfile.elasticsearch | ||
args: | ||
- ELASTIC_STACK_VERSION=$ELASTIC_STACK_VERSION | ||
- INTEGRATION=${INTEGRATION:-false} | ||
- SECURE_INTEGRATION=${SECURE_INTEGRATION:-false} | ||
- DISTRIBUTION_SUFFIX=${DISTRIBUTION_SUFFIX} | ||
command: /usr/share/elasticsearch/elasticsearch-run.sh | ||
tty: true | ||
ports: | ||
- "9200:9200" | ||
user: elasticsearch | ||
|
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
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 |
---|---|---|
@@ -1,19 +1,12 @@ | ||
--- | ||
sudo: required | ||
services: docker | ||
addons: | ||
apt: | ||
packages: | ||
- docker-ce | ||
import: | ||
- logstash-plugins/.ci:travis/travis.yml@1.x | ||
|
||
env: | ||
- INTEGRATION=false ELASTIC_STACK_VERSION=5.x | ||
- INTEGRATION=false ELASTIC_STACK_VERSION=6.x | ||
- INTEGRATION=false ELASTIC_STACK_VERSION=7.x | ||
- DISTRIBUTION=default INTEGRATION=false ELASTIC_STACK_VERSION=6.x | ||
- DISTRIBUTION=default INTEGRATION=false ELASTIC_STACK_VERSION=7.x | ||
- DISTRIBUTION=default INTEGRATION=true ELASTIC_STACK_VERSION=6.x | ||
- DISTRIBUTION=default INTEGRATION=true ELASTIC_STACK_VERSION=7.x | ||
- DISTRIBUTION=default INTEGRATION=true ELASTIC_STACK_VERSION=7.x SNAPSHOT=true | ||
- DISTRIBUTION=default INTEGRATION=true ELASTIC_STACK_VERSION=8.x SNAPSHOT=true | ||
- DISTRIBUTION=default SECURE_INTEGRATION=true INTEGRATION=true ELASTIC_STACK_VERSION=7.x | ||
- DISTRIBUTION=oss INTEGRATION=true ELASTIC_STACK_VERSION=7.x | ||
install: ci/docker-setup.sh | ||
script: ci/docker-run.sh |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.