Commit graph

63 commits

Author SHA1 Message Date
Colin Surprenant
193022c97b exclusive file locking class and tests
use new bin/ruby and bundler without :development

refactor to DRY and use expected exception

added original Apache 2.0 license and some cosmetics

exclude bin/lock from packaging

rename variables
2017-01-31 13:50:24 -05:00
Suyog Rao
2eb8b661ba Generate notice file during artifact build (#6538)
* Generate notice file during artifact build

Adjust our existing NOTICE.txt file to be built every time. This ensures
we collect LICENSE and NOTICE information of all bundled Logstash and non-Logstash
dependencies.

Changes:

* if NOTICE file is present in gems, include that text in our own NOTICE.TXT file.
* we also need to include the whole copyright block in NOTICE (meaning copyright + license)
2017-01-16 10:10:18 -08:00
Suyog Rao
fedcd9a171 Build queue along with other gems
Fixes #6473
2017-01-03 14:04:00 -05:00
Jordan Sissel
4f6d9d1c86 Add comment referring to another research effort
Fixes #6276
2016-12-06 13:17:36 -05:00
Colin Surprenant
ab05082a89 merge feature/java_persistence into 5.x 2016-10-31 17:03:40 -04:00
Suyog Rao
6c4fed1154 Remove logrotate completely
Fixes #5903
2016-09-13 19:39:28 -04:00
Suyog Rao
b7846a1f11 use the right props file
Fixes #5903
2016-09-13 19:39:28 -04:00
Suyog Rao
e2d2977870 add package specific log4j2 logging props
Fixes #5894

Fixes #5903
2016-09-13 19:39:27 -04:00
Suyog Rao
254297eec7 [5.x] Bump version to 5.1.0 (#5881)
* [5.x] Bump version to 5.1.0
2016-09-08 08:35:53 -07:00
Tal Levy
b545b83390 Migrate Logstash to Log4j2 Logging (#5651)
Migrate to use Log4j2 for Logstash logging
2016-08-26 18:11:22 +00:00
Pere Urbón
2c25592fd5 add bin/rspec and bin/rspec.bat to the packaging exclude list (#5667) 2016-08-24 09:54:32 +01:00
Joao Duarte
c03c5523a3 add data.path setting
Fixes #5528
2016-06-24 07:32:25 -04:00
Joao Duarte
0313712a37 avoid using duplicate logstash.yml for rpm/deb
Fixes #5537
2016-06-22 14:10:18 -04:00
Joao Duarte
fa0eeb579f add single command release task and other release support tooling
Purpose:

* manage releases through a minimum number of rake tasks
* simplify building of snapshot builds
* create staged artifacts, candidates for releases, that required no changes to become releases
* this means the snapshot release process will not involve publishing gems, therefore:
* the gem artifacts should only be published to rubygems as a final artifact, at the time of GA

Changes:

* release artifacts no longer depend on gems of core components
* all core components are used locally AS-IS to minimize code changes between snapshot, RC and GA
* `versions.yml` describes the versions of all logstash parts and package
  * `rake version:set[version]` manage the yaml file and push the changes to the gemspecs/version.rb files
  * `rake version:set_plugin_api[version]` manage the yaml file and push the changes to the gemspecs/version.rb files
  * `rake artifact:all` generates SNAPSHOT artifacts: tar.gz, zip, rpm, deb
  * `RELEASE=1 rake artifact:all` creates release candidate artifacts + 4 gems: logstash-core, logstash-core-event, logstash-core-event-java and logstash-core-plugin-api

implements #5416 and #5414

Fixes #5460
2016-06-21 12:29:18 +01:00
Pier-Hugues Pellerin
1c6f97b86a Allow to run acceptance test with the local logstash
This change introduce a new command ci/ci_acceptance which is
responsable of building the packages, bootstraping the acceptance test
environment, launching the VMs and running the tests.

You can use the following command to target specific platform.

```
ci/ci_acceptance.sh all
ci/ci_acceptance.sh centos
ci/ci_acceptance.sh debian
```

This PR also add a new rake task to build all the artifacts in a single
run called rake artifact:all it make sure we only install the plugin
only once and make the build process faster.

Fixes #5350
2016-06-02 14:37:16 +00:00
Aaron Mildenstein
6c886845e6 Update packaging to use /usr/share/logstash
Update after-install scripts

Use /usr/lib/logstash instead of /opt/logstash

More revisions.

Using `/usr/share/logstash` instead of `/usr/lib/logstash`

Track these new files

More work in progress.

Proper arg parsing obtained

WIP: Use jvm.options like ES

Remove facter dependency

Due to an update from @jordansissel on pleaserun, facter is no longer necessary

Revert Gemfile to proper version

Latest work in progress.

I added a simple test to logstash.lib.sh to catch empty strings in java options.

Added `startup.options`, and touched up `jvm.options`

Edited the package scripts to make things play nice with new paths.

Tweaked `system-install` to allow users to provide their own `startup.options` file.

Patch up merge failure

Changes to work with the new logstash.yml

Add fpm dependency (build fails without it)

Fix missing gems in Gemfile

Don't know how these got lost

Use /etc/logstash for configuration in packages

Update the instructions/documentation for...

...startup.options

Merging proposed changes

Remove mustache and clamp

They're covered by pleaserun anyway

Prune config dir from /usr/share/logstash...

...but only when using RPM/DEB packages
2016-05-25 11:43:48 -06:00
Joao Duarte
3a6b1dafaa introduce yaml settings file and cli long switches
* by default lives in LOGSTASH_HOME/config/logstash.yml
* location can be changed by $LS_SETTINGS_DIR or --path.settings
* overrides defaults of LogStash::Environment, BUT
* CLI flags override the yaml file
* several breaking changes to cli flag names (see config/logstash.yml)
* setting values are now type checked (see Setting and Settings classes)

Fixes #5313
2016-05-19 19:20:37 +01:00
Suyog Rao
ad17228d3a Remove java7 from rakelib
Fixes #5298
2016-05-13 22:29:29 +00:00
Pier-Hugues Pellerin
6ea07db5d9 Remove the architecture in the RPM and Debian artifacts
Logstash will now generate theses filenames instead:

```
logstash-5.0.0.rpm
logstash-5.0.0.deb
```
Fixes #5249

Fixes #5262
2016-05-09 19:21:57 +00:00
Jordan Sissel
e952f19904 Force RPM OS to be set to linux. Fixes #5147
Fixes #5156
2016-04-21 15:08:46 +00:00
Pier-Hugues Pellerin
6c47f49638 Normalize the name of the generated artifacts
This PR introduce a unified naming scheme for all our artifacts and will
produce the following files:

logstash-5.0.0-alpha1_all.deb
logstash-5.0.0-alpha1.tar.gz
logstash-5.0.0-alpha1.zip
logstash-5.0.0-alpha1.noarch.rpm

Fix #5100

Fixes #5125
2016-04-18 13:22:28 +00:00
Pere Urbon-Bayes
5808782345 Make the logstash-core-plugin-api install locally in case of having a :path in the Gemfile, works the same way as other "core" gems used for master branch.
Fixes #4908
2016-03-29 13:47:17 +00:00
Joao Duarte
fffe5883ae include hidden ruby-maven directory in packaging
ruby-maven ships a hidden directory called .mvn that
needs to be included in the package.
Currently the list of files to be packaged is generated using
Rake::FileList[globs] which excludes hidden files by default
(same happens with Dir.glob).

The fix is to ensure the contents of that directory are included
by explicitly referencing it.

For example, the file "extensions.xml", included in this directory,
is responsible for loading the ruby DSL for POMs. Not carrying this
file in the logstash package breaks any plugin update that uses
jar-dependencies.

Fixes #4845
2016-03-18 20:48:29 +00:00
JWhy
c75a7af326 Fix deb packaging task description
Fix description of the task package("ubuntu", ...). Likely caused by copy-paste.

Fixes #4601
2016-02-02 14:25:51 +00:00
Suyog Rao
62f56ec274 Fix issue when building regular tar
Thanks to @ph who caught this issue in review
https://github.com/elastic/logstash/pull/4435#discussion_r49224181

Fixes #4440
2016-01-09 02:27:28 +00:00
Suyog Rao
6e94d0c68b Add rake tasks to create uber packages
Add rake tasks to create zip and tar.gz for LS package with all plugins
installed from losgtash-repo

Fixes #4435
2016-01-08 23:08:21 +00:00
Vincent Bernat
4bc5261895 pkg: ensure dev/beta/rc are ordered before a regular version
```ruby
class DpkgVersion
  include Comparable
  attr :version
  def <=>(anOther)
    return -1 if system("dpkg --compare-versions #{version} lt #{anOther.version}")
    return 1 if system("dpkg --compare-versions #{version} gt #{anOther.version}")
    return 0
  end
  def initialize(version)
    @version = version
  end
  def to_s
    @version
  end
end

versions="1.5.1 1.5.0 1.5.0.rc3 1.5.0.beta2 1.5.0.alpha3".split
versions=versions.map { |x| DpkgVersion.new(x.gsub(/\.([[:alpha:]])/, '~\1')) }
versions=versions.sort
puts versions
```

This outputs:

```
1.5.0~alpha3
1.5.0~beta2
1.5.0~rc3
1.5.0
1.5.1
```

Fixes #2461
2015-12-11 20:17:33 +00:00
Colin Surprenant
1a32c14eac fix version path, relates to #4123 2015-11-17 01:13:11 -05:00
Colin Surprenant
d74d41cb30 logstash-core & logstash-core-event extraction to support logstash-core-event-java impl, relates to #4191
fixed timezone issue

extracted logstash-core and reorganized specs

extracted logstash-core-event

extract java Event into logstash-core-event-java in a proper gem

remove obsolete jruby_event bootstrapping

fix require path

add java code bootstrap

use logstash-core-event/logstash-core-event.rb

remove obsolete files

basic instructions

LogStash::Json need to be initialized from event

update jruby and gradle versions

update compile:logstash-core-event-java rake task

WIP tasks refactor

fix gem.files

skip test if class is not defined

fix gem related tasks for new structure

add gem spec dirs in core tests

bootstrap java implementation when requiring timestamp

new Cloner class and Event clone impl

fix array fields assignments, see #4140

don't rely on json implementation ordering

fix skipped last iterpolation char

remove implementation specific unnecessary check

also require ruby classes

define error class in ruby

raise exception on invalid format

remove implementation specific tests and extract and put logger related test in pending

missing bits for having all core timestamp specs pass

run all core specs

remove leftover

comment regex

missing encoding header

revert to logstash-core-event by default

finished proper gemification

useless require

dynamically pick specs depending on logstash-core-event-* implementation

logstash root package version

missing file for proper gemification

do not build java event by default

always check for root logstash lib dir

fix concurrent-ruby version confict

fix rebase conflict

re-enable specs

user vars instead of constants

move non core code in bootstrap

document version files

move version file

remove useless code

use version in logstash-core

fix gem files list

put back concurrent-ruby version constrain as in master

add dependency on logstash-core-event

remove dependency on logstash-core to avoid circular dependency

fix rebase conflict

remove circular dependency

fix specs

update README
2015-11-16 16:40:19 -05:00
Suyog Rao
fb5c388693 Add comma after new line was added
Fixes #3472
2015-06-19 17:09:25 +00:00
Suyog Rao
f26ab64ec4 Add NOTICE.TXT to comply with License
Fixes #3458
2015-06-19 16:47:10 +00:00
Jordan Sissel
4b325bd2de Set package epoch to 1
This is done because we made a mistake in the versioning of the rpm and
debs.

rpm and deb both sort "1.5.0.rc4" to be newer than "1.5.0". The default
epoch is 0, so setting epoch to 1 will cause "1.5.0" to sort higher than
the release candidates and betas.
2015-05-14 11:28:44 -07:00
Pere Urbon-Bayes
286dac435e make rubyzip a dependency installed via the Gemfile, so the artifact:zip task works as expected 2015-05-06 15:46:10 +02:00
Colin Surprenant
7a1ec64c23 use :build dependencies
fix octokit dep

fixes #3171
2015-05-06 08:27:57 -04:00
Colin Surprenant
07b6f4533c support remote or local gem packaging
typo
2015-05-04 20:50:44 -04:00
Colin Surprenant
48bcc5b74d cleanup dependencies and rely on logstash-core gem
remove unused load path

use either local core lib dir or logstash-core gem

include spec in logstash-core

do not include lib, spec and locales dirs in package root

environment bootstrapping in lib/bootstrap.rb

added comments

move pluginmanager out of logstash-core

kafla installation solved by pluginmanager refactor

refactor bootstrap code

refactor shell scripts to simplify and DRY, indirect rspec command to our ruby launcher

add bin/rspec

cut by half the bin/plugin and bin/rspec startup time

fix drip context

use printf instead of tr

updated Windows bin scripts

missing gemspec in gemspec

use gem instead of gemspec so our plugin manager can correctly install logstash-core

generate packages including locally built logstash-core gem

move jenkins developmnent dependencies into Gemfile, they do not belong in logstash-core

path leftover

clean help agent help usage message and remore rspec in available command

comments cosmetics

update Bundler dependency, all recent testing have been made with 1.9.4

updated .lock file with regard to updated Gemfile

cleanup gemspec, Gemfile and regen .lock file

added progress output

avoid dual require on version

closes #3096
2015-05-04 18:17:22 -04:00
Colin Surprenant
c70f252fe4 remove unwanted files in package 2015-04-22 18:49:35 +02:00
Colin Surprenant
4e1246a5b5 remove freeze task 2015-04-22 18:49:21 +02:00
Pere Urbon-Bayes
0b72d06de8 add an rspec shim to complement the old bin/logstash rspec way of running specs in logstash
simplify the rspec shim codebase

add bin/rspec to the exclude list for packaging

removed leftover

Fixes #3047
2015-04-20 15:47:46 +00:00
Colin Surprenant
bde2691239 bin/bundle shim
use  instead for $:

exclude bin/bundle from packages

added comment
2015-04-20 17:07:52 +02:00
Pier-Hugues Pellerin
782e5a2497 wrong
Fixes #2861
2015-03-23 16:14:49 +00:00
Colin Surprenant
f1e3f057ee handle defauls Gemfile and .lock file
Fixes #2766
2015-03-04 20:29:06 +00:00
Pere Urbon-Bayes
cc93c32be5 add the logstash-core.gem to the artifact build
Fixes #2708
2015-02-27 15:37:01 +00:00
Pier-Hugues Pellerin
9e7d6204a5 plugins/bundler refactor
squashed 113 commits by @ph, @colinsurprenant, @jordansissel, @purbon, @jsvd

cleaning the environment.rb

initial work

remove multiples polyglot

force to load rubygems

notice

point to one config

update lock

bootstrap will package the standard application until we have the plugin manager on top of the gemfile

add the gem path to find bundler

fixing dependencies

add gemfiles and bundle

comment platform requiremments in the gemfile

Set `Gem.paths = ...` to the GEM_HOME

Without this, `bin/logstash` will error:

    LoadError: no such file to load -- bundler
         require at org/jruby/RubyKernel.java:1071
         require at C:/Users/jls/Documents/GitHub/logstash/vendor/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require
.rb:55
         set_gem_paths! at C:/Users/jls/Documents/GitHub/logstash/lib/logstash/environment.rb:64
         (root) at C:\Users\jls\Documents\GitHub\logstash\lib\logstash\runner.rb:8

Patch JRuby's jar_installer.rb with a newer version

jar-dependencies is shipped by default with JRuby. However, the version
it ships with has a bug, and despite upgrading jar-dependencies to
0.1.7, which has the fix, JRuby continues to load the "shipped" version
which has a bug.

This patch will patch JRuby by copying in our own jar_installer.rb from
jar-dependencies master, This patching occurs while unpacking JRuby just
after `vendor:jruby`.

The jar_installer.rb is MIT-licensed and no changes were made.

Add `test:plugins` to test all installed plugins

Tell rspec to do the wildcards instead of trying to make the shell do it.

This fixes test runs on Windows (which doesn't do wildcards like this).
The solution was to tell RSpec to look for all files matching a certain path pattern
within the GEM_HOME.

do not run bundle install twice for test:plugins

Gemfile manipulation classes

Gemfile now in root

install POC with new Gemfile classes

specs for the Gemfile classes

header, some bug fixes

spec header

WIP pluginmanager refactor

generated format

updated .lock

unused file

removed --proxy option

fail elegantly

initial support for update

refactor invoke_bundler, debug output

removed old .lock file

no plugin Gemfile

use clamp error handling

reenable list, some cleanups

support for more finders

refactored using new finders

refactor using is_installed_plugin? and some cleanups

verify valid plugin and update all now only update plugins not all gems

support multiple plugins argument, --force option to bypass validation

list only explicitly installed plugins by default, --all option to include dependencies

support multiple plugins argument

renamed all_installed_plugins to all_installed_plugins_gem_specs and return specs, added comments

remove then

update_gem bug, comments

moved gems as development dependencies

updated .lock file

support for :without

--development option, better output feedback, cleanups

abort when no plugins

cosmetic

param fix, cleanups

removed deprecated .lock files

remove deprecated bundler_install_command and struggling with set_gem_paths

refactored all bundler stuff into LogStash::Bundler

rakelib refactor

refactored bundler code

Bundler.real_fuckin_reset

real_fuckin_reset is now reset_settings, removed unnecessary resetings, cleanups

duplicate plugins requirements merging

cleanups

added vendor:rake, cleanups

broke test tasks into 2 steps, first invoke install then test

rake task name fix

proper error exit code

Freezing the jar-dependencies, ruby-maven, tools

set gem paths on error

renamed TEST_PLUGINS to CORE_PLUGINS, added comments

replace test by core, cleanups

DRYied test tasks

missing gemspec

fixed output

correct image build for artifacts

removed deprecated Gemfiles

fix update with multiple plugins arguments

fix update with multiple plugins arguments

remove deprecated code

implicit begin, explicit block

spec for LogStash::Bundler

remove explit require of rubygems

renamed Environment.set_gem_paths! to bundler_setup!

rename Dsl to DSL

respect to_s contract and return empty string not nil

rename DSL.parse gemfile argument to gemfile_content

better error message

renamed --force to --[no-]verify

refactored exit error handling

use explicit array items in iterators

fix --development switch validation, cleaned bundler_options hash init

renamed is_xxx? methods to xxx?

use direct method call on collection

removed double negative, typo

move maven tools monkey patch into maven_tools_patch.rb

renamed build-image to prepare

fix forgotten argument name change

namespace cleanups

spec files glob pattern

cleanup

cleanup

cleanup

Fix the file-dependencies version to 0.1.5 to fix path issues on windows

monkeypatch Rubygems to silence ffi warning

list all plugin gems by default, new options

adding rake task to get faster feedback loop on windows

refactor bat scripts

Use an unreleased filedependencies gem and skip installing drupal

bump file-dependencies

use the released gem of file-dependencies

Add a set of scripts that simplify:   * The necessary setup for the CI test to be executed.   * The actuall CI test execution, having a different scripts for each     different workflow. This makes the test execution simpler and standard, so changes in internal task don't need big changes in the CI config. It also documents and makes easy for developers to run the tests.

Fixes #2640

refactored test to not depend on STDOUT

create a .rspec file to pass some options used while the code is in the testing environment

add coveralls and simplecov as a development dependencies so we can run coverage tests

remove unnecessary .bundle directory from the artifact

In a release, the .bundle/config has a BUNDLE_PATH setting that can
interfere by misleading the plugin manager into not seeing the
vendor/bundle path.

Fixes #2647

Fixes #2475
2015-02-20 17:31:43 +00:00
Jordan Sissel
b7455cbb2b Delete the zipfile before building it.
If we don't' do this, Zip::File.new and despite the Zip::File::CREATE
flag, will reopen an existing zip file instead of writing a new one.

The error you get without this patch is

    rake aborted!
    add failed. Entry logstash-2.0.0.dev/LICENSE already exists
    /Users/jls/projects/logstash/vendor/bundle/jruby/1.9/gems/rubyzip-1.1.6/lib/zip/file.rb:392:in
    `check_entry_exists'

Fixes #2456
2015-01-28 00:16:15 +00:00
Pere Urbon-Bayes
188b6a2aba fix the exclude variable naming
Fixes #2285
2015-01-05 15:50:16 +00:00
Pere Urbon-Bayes
3472fabb3a move the specs cleaning for logstash plugins to packaging time
Fixes #2285
2015-01-05 15:50:15 +00:00
wiibaa
395cb7563b Update for windows to execute rake bootstrap and bin\logstash.bat
Fixes #2085
2014-12-22 21:46:25 +00:00
Richard Pijnenburg
0f185a470e Add creation of zipfile for the artifacts
Fixes #2221
2014-12-16 20:29:33 +00:00
Joao Duarte
9a8551009b exclude rake files from artifacts
Fixes #2229
2014-12-12 23:56:11 +00:00