Skip to content
This repository was archived by the owner on Feb 5, 2021. It is now read-only.

Commit 70e23ce

Browse files
author
Bin Yi
authored
Merge pull request #122 from SumoLogic/byi-auto-build
Automatically build with Travis CI
2 parents 204463d + 542c2e4 commit 70e23ce

File tree

6 files changed

+81
-12
lines changed

6 files changed

+81
-12
lines changed

.gitignore

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
1-
.idea
1+
# Ruby ignores
2+
*.bridgesupport
3+
*.gem
4+
*.rbc
5+
.dat*
6+
.bundle/*
7+
.ruby-gemset
8+
.ruby-version
9+
.rvmrc
10+
bin/*
211
coverage
12+
Gemfile.lock
13+
TAGS
14+
15+
# Mac OSX ignores
16+
.DS_Store
17+
18+
# VS Code ignores
19+
.vscode/*
20+
21+
# idea ignores
22+
.idea

.travis.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
lang: ruby
2-
3-
script: bundle exec rake
4-
5-
rvm: 2.3
2+
services: docker
3+
before_install:
4+
- rm -f ./Gemfile.lock
5+
- gem install bundler
6+
script: ci/build.sh
7+
deploy:
8+
provider: rubygems
9+
skip_cleanup: true
10+
api_key:
11+
secure: utz+1f2fW1CTu3rTcvpqz6kcQQak4+1Fb4MvlCHKE4nqjC2ujhxjagzXydFwBVuyrw+/VvFfNshZuO5Drz3qpvcLAqPd7ptru3bnYDiwMTFBiVg3SSVtTFphlNKuwNwM4alT/7Jhi3eW0LVXYAXPA3nhh7fOkTbJb9J2FcKD1/ty1ybgFVeUJlaJ8pcqA0Q4PD/dW/6CMkzt4x2CDgsE+MsufFg2SqGelxty1vWIk4oBa6PsDgAoauX8d9KUsa5MRFi7OWTrZviDKwfHRrTb99jW/k+4iQX0+gwIWDOQwTrajQreNIShvwciiA71MdQ60uFNPQYLretrt2C1cIyeB6Vyt/ozGREo6JfLpCNiwwS2PmWknDsa4nQFytrE6wH9qRQz89Q8vkr4dMlneVIgUDkQBVe7nVuatKOBMwN+ZxHLoDdVcGzLz2wWIzc7FcIiUWFphOiWmZB8G4+St+zOyVCTM25qHby9xs0DDveXyCLXCL2CCip7lG7ZnBaWrmW43YvLKKip2NGmlmi6oecsvT8IbCMxJoj5hGgJXbzYC8dAJ0ZATuVbQuzn94hhPwWWOLkcJ3xqg8jzEwoiMhYvzjvywTlKlc+lgglXIvQVfA4HXmttYX1WkbXuQD4CtdUgdB5JznsaVQo3n9UwD1iiAk/kuwWyKOOC+AmSX2SKlb0=
12+
gem: fluent-plugin-kubernetes_sumologic
13+
on:
14+
tags: true
15+
repo: SumoLogic/fluentd-kubernetes-sumologic

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM fluent/fluentd:v1.3.2-debian AS builder
22

33
ENV PATH /home/fluent/.gem/ruby/2.3.0/bin:$PATH
44

5+
COPY ./fluent-plugin-kubernetes_sumologic*.gem ./
6+
57
# New fluent image dynamically creates user in entrypoint
68
RUN [ -f /bin/entrypoint.sh ] && /bin/entrypoint.sh echo || : && \
79
apt-get update && \
@@ -14,6 +16,7 @@ RUN [ -f /bin/entrypoint.sh ] && /bin/entrypoint.sh echo || : && \
1416
gem install fluent-plugin-concat -v 2.3.0 && \
1517
gem install fluent-plugin-rewrite-tag-filter -v 2.1.0 && \
1618
gem install fluent-plugin-prometheus -v 1.1.0 && \
19+
gem install fluent-plugin-kubernetes_sumologic && \
1720
rm -rf /home/fluent/.gem/ruby/2.3.0/cache/*.gem && \
1821
gem sources -c && \
1922
apt-get remove --purge -y build-essential ruby-dev libffi-dev libsystemd-dev && \
@@ -61,10 +64,8 @@ ENV K8S_METADATA_FILTER_BEARER_CACHE_TTL "3600"
6164
ENV VERIFY_SSL "true"
6265

6366
COPY --from=builder /var/lib/gems /var/lib/gems
64-
6567
COPY ./conf.d/ /fluentd/conf.d/
6668
COPY ./etc/* /fluentd/etc/
67-
COPY ./lib/fluent/plugin/* /fluentd/plugins/
6869
COPY ./entrypoint.sh /fluentd/
6970

7071
ENTRYPOINT ["/fluentd/entrypoint.sh"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/SumoLogic/fluentd-kubernetes-sumologic.svg?branch=master)](https://travis-ci.org/SumoLogic/fluentd-kubernetes-sumologic) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/SumoLogic/fluentd-output-sumologic/issues)
1+
[![Build Status](https://travis-ci.org/SumoLogic/fluentd-kubernetes-sumologic.svg?branch=master)](https://travis-ci.org/SumoLogic/fluentd-kubernetes-sumologic) [![Gem Version](https://badge.fury.io/rb/fluent-plugin-kubernetes_sumologic.svg)](https://badge.fury.io/rb/fluent-plugin-kubernetes_sumologic) [![Docker Pulls](https://img.shields.io/docker/pulls/sumologic/fluentd-kubernetes-sumologic.svg)](https://hub.docker.com/r/sumologic/fluentd-kubernetes-sumologic) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/SumoLogic/fluentd-output-sumologic/issues)
22

33
This page describes the Sumo Kubernetes [Fluentd](http://www.fluentd.org/) plugin.
44

ci/build.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/sh
2+
3+
echo "Starting build process in: `pwd`"
4+
set -e
5+
6+
VERSION="${TRAVIS_TAG:-0.0.0}"
7+
VERSION="${VERSION#v}"
8+
: "${DOCKER_TAG:=sumologic/fluentd-kubernetes-sumologic}"
9+
: "${DOCKER_USERNAME:=sumodocker}"
10+
PLUGIN_NAME="fluent-plugin-kubernetes_sumologic"
11+
12+
echo "Building for tag $VERSION, modify .gemspec file..."
13+
sed -i.bak "s/0.0.0/$VERSION/g" ./$PLUGIN_NAME.gemspec
14+
rm -f ./$PLUGIN_NAME.gemspec.bak
15+
16+
echo "Install bundler..."
17+
bundle install
18+
19+
echo "Run unit tests..."
20+
bundle exec rake
21+
22+
echo "Build gem $PLUGIN_NAME $VERSION..."
23+
gem build $PLUGIN_NAME
24+
25+
echo "Building docker image with $DOCKER_TAG:$VERSION and $DOCKER_TAG:latest in `pwd`..."
26+
docker build . -f ./Dockerfile -t $DOCKER_TAG:v$VERSION --no-cache
27+
docker build . -f ./Dockerfile -t $DOCKER_TAG:latest
28+
if [ -z "$DOCKER_PASSWORD" ] || [ -z "$TRAVIS_TAG" ]; then
29+
echo "Skip Docker pushing"
30+
else
31+
echo "Pushing docker image with $DOCKER_TAG:$VERSION and $DOCKER_TAG:latest..."
32+
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
33+
docker push $DOCKER_TAG:v$VERSION
34+
docker push $DOCKER_TAG:latest
35+
fi
36+
37+
rm -f ./*.gem
38+
39+
echo "DONE"

fluent-plugin-kubernetes_sumologic.gemspec

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
44

55
Gem::Specification.new do |gem|
66
gem.name = "fluent-plugin-kubernetes_sumologic"
7-
gem.version = "2.0.0"
8-
gem.authors = ["Frank Reno"]
9-
gem.email = ["frank.reno@me.com"]
7+
gem.version = "0.0.0"
8+
gem.authors = ["Sumo Logic"]
9+
gem.email = ["collection@sumologic.com"]
1010
gem.description = %q{FluentD plugin to extract logs from Kubernetes clusters, enrich and ship to Sumo logic.}
1111
gem.summary = %q{FluentD plugin to extract logs from Kubernetes clusters, enrich and ship to Sumo logic.}
1212
gem.homepage = "https://github.com/SumoLogic/fluentd-kubernetes-sumologic"
@@ -16,7 +16,6 @@ Gem::Specification.new do |gem|
1616
gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
1717
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
1818
gem.require_paths = ["lib"]
19-
gem.has_rdoc = false
2019

2120
gem.required_ruby_version = '>= 2.0.0'
2221

0 commit comments

Comments
 (0)