diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..5876619 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +ruby 3.4.8 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9fc13c9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - - docker -install: skip -jobs: - include: - - name: test - script: - - make test diff --git a/Gemfile.lock b/Gemfile.lock index c1f205d..4f0042e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,67 +1,126 @@ PATH remote: . specs: - fluent-plugin-annotation-filter (1.0.6) - fluentd (~> 1.16.1, >= 1.16.1) + fluent-plugin-annotation-filter (1.1.0) + fluentd (~> 1.19.2, >= 1.19.2) GEM remote: https://rubygems.org/ specs: - concurrent-ruby (1.2.2) - cool.io (1.8.0) - diff-lcs (1.5.0) - fluentd (1.16.2) + async (2.36.0) + console (~> 1.29) + fiber-annotation + io-event (~> 1.11) + metrics (~> 0.12) + traces (~> 0.18) + async-http (0.94.2) + async (>= 2.10.2) + async-pool (~> 0.11) + io-endpoint (~> 0.14) + io-stream (~> 0.6) + metrics (~> 0.12) + protocol-http (~> 0.58) + protocol-http1 (~> 0.36) + protocol-http2 (~> 0.22) + protocol-url (~> 0.2) + traces (~> 0.10) + async-pool (0.11.1) + async (>= 2.0) + base64 (0.3.0) + concurrent-ruby (1.3.6) + console (1.34.3) + fiber-annotation + fiber-local (~> 1.1) + json + cool.io (1.9.3) + csv (3.3.5) + diff-lcs (1.6.2) + drb (2.2.3) + fiber-annotation (0.2.0) + fiber-local (1.1.0) + fiber-storage + fiber-storage (1.0.1) + fluentd (1.19.2) + async-http (~> 0.86) + base64 (~> 0.2) bundler cool.io (>= 1.4.5, < 2.0.0) + csv (~> 3.2) + drb (~> 2.2) http_parser.rb (>= 0.5.1, < 0.9.0) + logger (~> 1.6) msgpack (>= 1.3.1, < 2.0.0) + net-http (~> 0.8) + ostruct (~> 0.6) serverengine (>= 2.3.2, < 3.0.0) sigdump (~> 0.2.5) strptime (>= 0.2.4, < 1.0.0) tzinfo (>= 1.0, < 3.0) tzinfo-data (~> 1.0) + uri (~> 1.0) webrick (~> 1.4) yajl-ruby (~> 1.0) - http_parser.rb (0.8.0) - msgpack (1.7.2) - power_assert (2.0.3) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + zstd-ruby (~> 1.5) + http_parser.rb (0.8.1) + io-endpoint (0.17.2) + io-event (1.14.3) + io-stream (0.11.1) + json (2.18.1) + logger (1.7.0) + metrics (0.15.0) + msgpack (1.8.0) + net-http (0.9.1) + uri (>= 0.11.1) + ostruct (0.6.3) + power_assert (3.0.1) + protocol-hpack (1.5.1) + protocol-http (0.59.0) + protocol-http1 (0.37.0) + protocol-http (~> 0.58) + protocol-http2 (0.24.0) + protocol-hpack (~> 1.4) + protocol-http (~> 0.47) + protocol-url (0.4.0) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.8) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) - serverengine (2.3.2) + rspec-support (~> 3.13.0) + rspec-support (3.13.7) + serverengine (2.4.0) + base64 (~> 0.1) + logger (~> 1.4) sigdump (~> 0.2.2) sigdump (0.2.5) strptime (0.2.5) - test-unit (3.6.1) + test-unit (3.7.7) power_assert + traces (0.18.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - tzinfo-data (1.2023.3) + tzinfo-data (1.2026.1) tzinfo (>= 1.0.0) - webrick (1.8.1) + uri (1.1.1) + webrick (1.9.2) yajl-ruby (1.4.3) + zstd-ruby (1.5.7.1) PLATFORMS aarch64-linux - arm64-darwin-21 - arm64-darwin-22 - x86_64-linux + ruby DEPENDENCIES - bundler (~> 2.3) + bundler (~> 2.6) fluent-plugin-annotation-filter! - rspec (~> 3.11) - test-unit (~> 3.5) + rspec (~> 3.13) + test-unit (~> 3.7) BUNDLED WITH - 2.3.24 + 2.6.9 diff --git a/Makefile b/Makefile index a37306a..f2741b2 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,12 @@ .PHONY: all help clean push test build -export VERSION = 1.0.6 -export AWS_DEFAULT_REGION = us-east-1 +RUBY_IMAGE := ruby:3.4.8-trixie +export VERSION = 1.1.0 -define AWS_CLI_CMD +define AWS docker container run --rm -i \ - -e AWS_ACCESS_KEY_ID \ - -e AWS_DEFAULT_REGION \ - -e AWS_SECRET_ACCESS_KEY \ - -e AWS_SESSION_TOKEN \ + -e AWS_PROFILE \ + -v "${HOME}/.aws:/root/.aws:ro" \ amazon/aws-cli:latest endef @@ -19,7 +17,7 @@ build: ## Create the docker image. --workdir=/app \ -v `pwd`:/app \ -e VERSION \ - ruby:3.1 \ + ${RUBY_IMAGE} \ gem build fluent-plugin-annotation-filter.gemspec test: ## Run the app tests. @@ -30,9 +28,10 @@ test: ## Run the app tests. -v `pwd`:/app \ -e VERSION \ -e BUNDLE_PATH=/app/gems \ - ruby:3.1 \ + ${RUBY_IMAGE} \ script/docker-rspec.sh +push: GEM_HOST_API_KEY = $(shell $(AWS) secretsmanager get-secret-value --secret-id rubygems_api_key --output json | jq -r '.SecretString | fromjson | .rubygems_api_key') push: build ## Publish the gem @echo "--- :fire: Pushing! :fire:" docker run \ @@ -41,12 +40,11 @@ push: build ## Publish the gem -v `pwd`:/app \ -e VERSION \ -e BUNDLE_PATH=/app/gems \ - -e GEM_HOST_API_KEY=$$(${AWS_CLI_CMD} secretsmanager get-secret-value --secret-id rubygems_api_key --output json | jq -r '.SecretString | fromjson | .rubygems_api_key') \ + -e GEM_HOST_API_KEY=$(GEM_HOST_API_KEY) \ -it \ - ruby:3.1 \ + ${RUBY_IMAGE} \ script/push-gem.sh - clean: ## Cleanup artifacts generated by build. @echo "--- :shower: Cleaning up :shower:" -rm *.gem diff --git a/UPDATE.md b/UPDATE.md new file mode 100644 index 0000000..5870b6a --- /dev/null +++ b/UPDATE.md @@ -0,0 +1,5 @@ +# Upgrading + +- Update `./fluentd-plugin-annotation-filter.gemspec` with dependencies +- Update `VERSION` in Makefile +- Run `make fluent-plugin-annotation-filter-$(VERSION).gem` diff --git a/fluent-plugin-annotation-filter.gemspec b/fluent-plugin-annotation-filter.gemspec index 676fcab..7cb0a3f 100644 --- a/fluent-plugin-annotation-filter.gemspec +++ b/fluent-plugin-annotation-filter.gemspec @@ -17,11 +17,11 @@ Gem::Specification.new do |gem| gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] - gem.required_ruby_version = '>= 3.1.2' + gem.required_ruby_version = '>= 3.1' - gem.add_runtime_dependency "fluentd", '~> 1.16.1', '>= 1.16.1' + gem.add_runtime_dependency "fluentd", '~> 1.19.2', '>= 1.19.2' - gem.add_development_dependency "bundler", "~> 2.3" - gem.add_development_dependency "rspec", "~> 3.11" # Like all our other Ruby projects, our tests are in RSpec - gem.add_development_dependency "test-unit", "~> 3.5" # TestUnit is, however, used by fluentd's test driver and must be included + gem.add_development_dependency "bundler", "~> 2.6" + gem.add_development_dependency "rspec", "~> 3.13" + gem.add_development_dependency "test-unit", "~> 3.7" # TestUnit is, used by fluentd's test driver and must be included end