Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #122 from strongdm/feat/add-gemspec
Browse files Browse the repository at this point in the history
Add gemspec
  • Loading branch information
camposer authored Oct 31, 2022
2 parents 8457115 + 9eea753 commit a1185f9
Show file tree
Hide file tree
Showing 13 changed files with 245 additions and 152 deletions.
33 changes: 33 additions & 0 deletions .gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Gem::Specification.new do |spec|
spec.name = 'log-export-container'
spec.licenses = ['Apache-2.0']
spec.summary = 'An application that can be easily deployed and configured to export strongDM query logs'
spec.description = 'The application acts as a syslog concentrator. Customers that want to export their strongDM query logs to a third party logging service can use the application to do so. They configure the application for the appropriate target. Deploy the application. Configure their strongDM gateways to logs to a syslog destination and set the destination to the address of the logging application host.'
spec.authors = ["StrongDM"]
spec.homepage = 'https://strongdm.github.io/log-export-container/'
spec.metadata = { "source_code_uri" => "https://github.com/strongdm/log-export-container" }
spec.files = ["create-conf.rb", "conf-utils.rb", "start.rb"] + Dir['fluentd/**/*.rb'] + Dir['fluentd/**/*.conf']
spec.executables = ["log-export-container"]
spec.version = ENV['LEC_VERSION'] || '0.0.0'

spec.add_dependency 'fluentd'
spec.add_dependency 'fluent'
spec.add_dependency 'fluent-plugin-rewrite-tag-filter'
spec.add_dependency 'fluent-plugin-s3'
spec.add_dependency 'fluent-plugin-cloudwatch-logs'
spec.add_dependency 'fluent-plugin-splunk-hec'
spec.add_dependency 'fluent-plugin-datadog'
spec.add_dependency 'fluent-plugin-azure-loganalytics'
spec.add_dependency 'fluent-plugin-sumologic_output'
spec.add_dependency 'fluent-plugin-sanitizer'
spec.add_dependency 'fluent-plugin-kafka'
spec.add_dependency 'fluent-plugin-mongo'
spec.add_dependency 'fluent-plugin-logzio'
spec.add_dependency 'fluent-plugin-grafana-loki'
spec.add_dependency 'fluent-plugin-remote_syslog'
spec.add_dependency 'fluent-plugin-elasticsearch', '5.2.4'
spec.add_dependency 'fluent-plugin-bigquery'
spec.add_dependency 'fluent-plugin-prometheus'
spec.add_dependency 'test-unit'
spec.add_dependency 'rspec'
end
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2

- name: Build and publish gem
env:
LEC_VERSION: ${{ steps.version.outputs.new_tag }}
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: |
mkdir ~/.gem
echo ":api-key: ${RUBYGEMS_API_KEY}" > ~/.gem/credentials
chmod 0600 /home/runner/.gem/credentials
gem build .gemspec
gem push ./log-export-container-${LEC_VERSION}.gem --key api-key
- name: Build, tag, and push the image to Amazon ECR
id: build-image
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: tests

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_dispatch:

jobs:
Expand All @@ -14,9 +14,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.1.2
- name: Install dependencies
run: bundle install
- name: Run tests
Expand Down
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM fluent/fluentd:edge-debian

ENV FLUENTD_DIR=fluentd
ENV FLUENTD_DIR=/fluentd

USER root
RUN apt-get update && \
Expand All @@ -19,12 +19,13 @@ RUN apt-get update && \
rm -rf /root/.cache /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY Gemfile /Gemfile
COPY .gemspec /.gemspec
RUN bundle install

COPY fluentd /fluentd
COPY create-conf.rb /create-conf.rb
COPY conf-utils.rb /conf-utils.rb
COPY start.sh /start.sh
COPY start.rb /start.rb

RUN curl -fsSLo sdm.zip \
$(curl https://app.strongdm.com/releases/upgrade\?os\=linux\&arch\=$(uname -m | sed -e 's:x86_64:amd64:' -e 's:aarch64:arm64:')\&software\=sdm-cli\&version\=productionexample | jq ".url" -r) && \
Expand All @@ -33,4 +34,4 @@ RUN curl -fsSLo sdm.zip \
mv sdm /bin && \
mkdir -p /root/.sdm

CMD ["/start.sh"]
CMD ["ruby", "/start.rb"]
20 changes: 1 addition & 19 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,4 @@ source 'https://rubygems.org'

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem 'fluent'
gem 'fluent-plugin-rewrite-tag-filter'
gem 'fluent-plugin-s3'
gem 'fluent-plugin-cloudwatch-logs'
gem 'fluent-plugin-splunk-hec'
gem 'fluent-plugin-datadog'
gem 'fluent-plugin-azure-loganalytics'
gem 'fluent-plugin-sumologic_output'
gem 'fluent-plugin-sanitizer'
gem 'fluent-plugin-kafka'
gem 'fluent-plugin-mongo'
gem 'fluent-plugin-logzio'
gem 'fluent-plugin-grafana-loki'
gem 'fluent-plugin-remote_syslog'
gem 'fluent-plugin-elasticsearch', '5.2.4'
gem 'fluent-plugin-bigquery'
gem 'fluent-plugin-prometheus'
gem 'test-unit'
gem 'rspec'
gemspec
Loading

0 comments on commit a1185f9

Please sign in to comment.