Skip to content

Commit

Permalink
Fix dependency problem on AWS SDK - awslabs#161
Browse files Browse the repository at this point in the history
  • Loading branch information
simukappu committed Jan 7, 2019
1 parent 96706e7 commit 4aa2300
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 35 deletions.
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ sudo: false
gemfile:
- Gemfile
- gemfiles/Gemfile.fluentd-0.14.10
# https://support.treasuredata.com/hc/en-us/articles/360001479187-The-td-agent-ChangeLog
- gemfiles/Gemfile.td-agent-3.1.1
- gemfiles/Gemfile.td-agent-3.2.0
- gemfiles/Gemfile.td-agent-3.2.1

env:
- AWS_SDK_VERSION=DEFAULT
- AWS_SDK_VERSION=1.3
# Test gem with default dependecy
- DEFAULT
# Test gem with fixed version of AWS SDK
- AWS_SDK_KINESIS_MAX_VERSION=1.9.0 AWS_SDK_FIREHOSE_MAX_VERSION=1.11.0

matrix:
exclude:
- gemfile: Gemfile
env: AWS_SDK_VERSION=1.3
include:
- rvm: 2.4.1
gemfile: gemfiles/Gemfile.fluentd-0.14.10
Expand All @@ -27,7 +27,8 @@ matrix:
- rvm: 2.4.4 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.2.1/config/projects/td-agent3.rb#L22
gemfile: gemfiles/Gemfile.td-agent-3.2.1
allow_failures:
- env: AWS_SDK_VERSION=1.3
# Temporarily allow failures to debug gem working with specified versions of AWS SDK
- gemfile: gemfiles/Gemfile.td-agent-3.1.1
fast_finish: true

script: bundle exec rake test
7 changes: 2 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
gemspec

# Use specified version of aws-sdk-kinesis and aws-sdk-firehose
unless ENV['AWS_SDK_VERSION'].nil? or ENV['AWS_SDK_VERSION'] == 'DEFAULT'
gem "aws-sdk-kinesis", "#{ENV['AWS_SDK_VERSION']}"
gem "aws-sdk-firehose", "#{ENV['AWS_SDK_VERSION']}"
end
# Load AWS SDK dependency from gemfiles/Gemfile.aws-sdk
instance_eval File.read('gemfiles/Gemfile.aws-sdk')
9 changes: 5 additions & 4 deletions fluent-plugin-kinesis.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ Gem::Specification.new do |spec|

# This plugin is sometimes used with s3 plugin, so watch out for conflicts
# https://rubygems.org/gems/fluent-plugin-s3
spec.add_dependency "aws-sdk-kinesis", "~> 1", "< 1.4"
spec.add_dependency "aws-sdk-firehose", "~> 1", "< 1.4"
# Avoid v1.5 due to this issue : https://github.com/aws/aws-sdk-ruby/issues/1872
spec.add_dependency "aws-sdk-kinesis", "~> 1", "!= 1.5"
spec.add_dependency "aws-sdk-firehose", "~> 1", "!= 1.5"

spec.add_dependency "google-protobuf", "~> 3"

spec.add_development_dependency "bundler", "~> 1.10"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "bundler", ">= 1.10"
spec.add_development_dependency "rake", ">= 10.0"
spec.add_development_dependency "test-unit", ">= 3.0.8"
spec.add_development_dependency "test-unit-rr", ">= 1.0.3"
spec.add_development_dependency "pry", ">= 0.10.1"
Expand Down
22 changes: 22 additions & 0 deletions gemfiles/Gemfile.aws-sdk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

# Use specified version of aws-sdk-kinesis
unless ENV['AWS_SDK_KINESIS_MAX_VERSION'].nil? or ENV['AWS_SDK_KINESIS_MAX_VERSION'] == 'DEFAULT'
gem "aws-sdk-kinesis", "<= #{ENV['AWS_SDK_KINESIS_MAX_VERSION']}"
end
# Use specified version of aws-sdk-firehose
unless ENV['AWS_SDK_FIREHOSE_MAX_VERSION'].nil? or ENV['AWS_SDK_FIREHOSE_MAX_VERSION'] == 'DEFAULT'
gem "aws-sdk-firehose", "<= #{ENV['AWS_SDK_FIREHOSE_MAX_VERSION']}"
end
7 changes: 2 additions & 5 deletions gemfiles/Gemfile.fluentd-0.14.10
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@ gemspec path: ".."

gem "fluentd", "0.14.10"

# Use specified version of aws-sdk-kinesis and aws-sdk-firehose
unless ENV['AWS_SDK_VERSION'].nil? or ENV['AWS_SDK_VERSION'] == 'DEFAULT'
gem "aws-sdk-kinesis", "#{ENV['AWS_SDK_VERSION']}"
gem "aws-sdk-firehose", "#{ENV['AWS_SDK_VERSION']}"
end
# Load AWS SDK dependency from gemfiles/Gemfile.aws-sdk
instance_eval File.read('gemfiles/Gemfile.aws-sdk')
7 changes: 2 additions & 5 deletions gemfiles/Gemfile.td-agent-3.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,5 @@ gem "aws-sdk-sqs", "1.3.0"
gem "aws-sdk-s3", "1.8.0"
gem "fluent-plugin-s3", "1.1.0"

# Use specified version of aws-sdk-kinesis and aws-sdk-firehose
unless ENV['AWS_SDK_VERSION'].nil? or ENV['AWS_SDK_VERSION'] == 'DEFAULT'
gem "aws-sdk-kinesis", "#{ENV['AWS_SDK_VERSION']}"
gem "aws-sdk-firehose", "#{ENV['AWS_SDK_VERSION']}"
end
# Load AWS SDK dependency from gemfiles/Gemfile.aws-sdk
instance_eval File.read('gemfiles/Gemfile.aws-sdk')
7 changes: 2 additions & 5 deletions gemfiles/Gemfile.td-agent-3.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,5 @@ gem "aws-sdk-sqs", "1.3.0"
gem "aws-sdk-s3", "1.13.0"
gem "fluent-plugin-s3", "1.1.3"

# Use specified version of aws-sdk-kinesis and aws-sdk-firehose
unless ENV['AWS_SDK_VERSION'].nil? or ENV['AWS_SDK_VERSION'] == 'DEFAULT'
gem "aws-sdk-kinesis", "#{ENV['AWS_SDK_VERSION']}"
gem "aws-sdk-firehose", "#{ENV['AWS_SDK_VERSION']}"
end
# Load AWS SDK dependency from gemfiles/Gemfile.aws-sdk
instance_eval File.read('gemfiles/Gemfile.aws-sdk')
7 changes: 2 additions & 5 deletions gemfiles/Gemfile.td-agent-3.2.1
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
gemspec path: ".."

# Use specified version of aws-sdk-kinesis and aws-sdk-firehose
unless ENV['AWS_SDK_VERSION'].nil? or ENV['AWS_SDK_VERSION'] == 'DEFAULT'
gem "aws-sdk-kinesis", "#{ENV['AWS_SDK_VERSION']}"
gem "aws-sdk-firehose", "#{ENV['AWS_SDK_VERSION']}"
end
# Load AWS SDK dependency from gemfiles/Gemfile.aws-sdk
instance_eval File.read('gemfiles/Gemfile.aws-sdk')

0 comments on commit 4aa2300

Please sign in to comment.