Skip to content

Commit

Permalink
[Build] Download Logstash from elastic.co instead of building from so…
Browse files Browse the repository at this point in the history
…urce
  • Loading branch information
robbavey committed Oct 17, 2018
1 parent 8ed9860 commit 6b637fa
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 47 deletions.
26 changes: 13 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ sudo: false
language: ruby
cache: bundler
env:
- INTEGRATION=false
- DISTRIBUTION=legacy INTEGRATION=true ES_VERSION=1.7.6 TEST_DEBUG=true
- DISTRIBUTION=legacy INTEGRATION=true ES_VERSION=2.4.4 TEST_DEBUG=true
- DISTRIBUTION=legacy INTEGRATION=true ES_VERSION=5.6.9 TEST_DEBUG=true
- DISTRIBUTION=oss INTEGRATION=true ES_VERSION=6.4.2 TEST_DEBUG=true
- DISTRIBUTION=default INTEGRATION=true ES_VERSION=6.4.2 TEST_DEBUG=true
- DISTRIBUTION=default INTEGRATION=true ES_VERSION=master TEST_DEBUG=true
- DISTRIBUTION=legacyxpack SECURE_INTEGRATION=true INTEGRATION=true ES_VERSION=5.6.9 TEST_DEBUG=true
- DISTRIBUTION=default SECURE_INTEGRATION=true INTEGRATION=true ES_VERSION=6.4.2 TEST_DEBUG=true
- LOGSTASH_VERSION=6.4.2 INTEGRATION=false
- LOGSTASH_VERSION=6.4.2 DISTRIBUTION=legacy INTEGRATION=true ES_VERSION=1.7.6 TEST_DEBUG=true
- LOGSTASH_VERSION=6.4.2 DISTRIBUTION=legacy INTEGRATION=true ES_VERSION=2.4.4 TEST_DEBUG=true
- LOGSTASH_VERSION=6.4.2 DISTRIBUTION=legacy INTEGRATION=true ES_VERSION=5.6.9 TEST_DEBUG=true
- LOGSTASH_VERSION=6.4.2 DISTRIBUTION=oss INTEGRATION=true ES_VERSION=6.4.2 TEST_DEBUG=true
- LOGSTASH_VERSION=6.4.2 DISTRIBUTION=default INTEGRATION=true ES_VERSION=6.4.2 TEST_DEBUG=true
- LOGSTASH_VERSION=6.4.2 DISTRIBUTION=default INTEGRATION=true ES_VERSION=master TEST_DEBUG=true
- LOGSTASH_VERSION=6.4.2 DISTRIBUTION=legacyxpack SECURE_INTEGRATION=true INTEGRATION=true ES_VERSION=5.6.9 TEST_DEBUG=true
- LOGSTASH_VERSION=6.4.2 DISTRIBUTION=default SECURE_INTEGRATION=true INTEGRATION=true ES_VERSION=6.4.2 TEST_DEBUG=true

rvm:
- jruby-1.7.25
matrix:
include:
- rvm: jruby-9.1.13.0
env: LOGSTASH_BRANCH=master
env: LOGSTASH_VERSION=7.0.0-alpha1-SNAPSHOT
- rvm: jruby-9.1.13.0
env: LOGSTASH_BRANCH=6.x
env: LOGSTASH_VERSION=6.5.0-SNAPSHOT
- rvm: jruby-9.1.13.0
env: LOGSTASH_BRANCH=6.4
env: LOGSTASH_VERSION=6.4.2
- rvm: jruby-1.7.27
env: LOGSTASH_BRANCH=5.6
env: LOGSTASH_VERSION=5.6.12
allow_failures:
- env: DISTRIBUTION=default INTEGRATION=true ES_VERSION=master TEST_DEBUG=true
fast_finish: true
Expand Down
14 changes: 4 additions & 10 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@
########################################################
set -e

echo "Starting build process in: `pwd`"
export LOGSTASH_PATH=$PWD/logstash-${LOGSTASH_VERSION}
source ./ci/setup.sh
export PATH=$LOGSTASH_PATH/vendor/jruby/bin:$LOGSTASH_PATH/vendor/bundle/jruby/1.9.3/bin:$LOGSTASH_PATH/vendor/bundle/jruby/2.3.0/bin:$PATH
export LOGSTASH_SOURCE=1

if [[ -f "ci/run.sh" ]]; then
echo "Running custom build script in: `pwd`/ci/run.sh"
source ./ci/run.sh
else
echo "Running default build scripts in: `pwd`/ci/build.sh"
bundle install
bundle exec rake vendor
bundle exec rspec spec
fi
jruby -S bundle exec rspec
48 changes: 24 additions & 24 deletions ci/setup.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#!/bin/bash
# version: 1
########################################################
#
# AUTOMATICALLY GENERATED! DO NOT EDIT
#
########################################################
set -e
if [ "$LOGSTASH_BRANCH" ]; then
echo "Building plugin using Logstash source"
BASE_DIR=`pwd`
echo "Checking out branch: $LOGSTASH_BRANCH"
git clone -b $LOGSTASH_BRANCH https://github.com/elastic/logstash.git ../../logstash --depth 1
printf "Checked out Logstash revision: %s\n" "$(git -C ../../logstash rev-parse HEAD)"
cd ../../logstash
echo "Building plugins with Logstash version:"
cat versions.yml
echo "---"
# We need to build the jars for that specific version
echo "Running gradle assemble in: `pwd`"
./gradlew assemble
cd $BASE_DIR
export LOGSTASH_SOURCE=1
else
echo "Building plugin using released gems on rubygems"
fi

download_logstash() {
logstash_version=$1
case "$logstash_version" in
*-SNAPSHOT)
wget https://snapshots.elastic.co/downloads/logstash/logstash-$logstash_version.tar.gz
;;
*)
wget https://artifacts.elastic.co/downloads/logstash/logstash-$logstash_version.tar.gz
;;
esac
}


echo "Downloading logstash version: $LOGSTASH_VERSION"
download_logstash $LOGSTASH_VERSION
tar -zxf logstash-$LOGSTASH_VERSION.tar.gz
export LOGSTASH_PATH=$PWD/logstash-${LOGSTASH_VERSION}
export PATH=$LOGSTASH_PATH/vendor/jruby/bin:$LOGSTASH_PATH/vendor/bundle/jruby/1.9.3/bin:$LOGSTASH_PATH/vendor/bundle/jruby/2.3.0/bin:$PATH
export LOGSTASH_SOURCE=1
cp $LOGSTASH_PATH/logstash-core/versions-gem-copy.yml $LOGSTASH_PATH/versions.yml
gem install bundler
jruby -S bundle install --jobs=3 --retry=3 --path=vendor/bundler
jruby -S bundle exec rake vendor

0 comments on commit 6b637fa

Please sign in to comment.