Skip to content

Commit

Permalink
Merge pull request #1 from funbox/develop
Browse files Browse the repository at this point in the history
Version 0.6.0
  • Loading branch information
andyone authored Feb 2, 2017
2 parents f97c453 + 4bfa8e4 commit c60ad20
Show file tree
Hide file tree
Showing 22 changed files with 2,996 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor
*~
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
sudo: false

language: go

go:
- 1.6.x
- 1.7.x
- tip

branches:
only:
- master
- develop

os:
- linux

matrix:
fast_finish: true
allow_failures:
- go: tip

before_install:
- make deps

script:
- make test
- make bin
- ./init-exporter --version
22 changes: 22 additions & 0 deletions Dockerfile.systemd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM centos:centos7

ENV GOPATH /root
ENV TARGET /root/src/github.com/funbox/init-exporter

RUN yum install -y http://release.yum.kaos.io/i386/kaos-repo-1.2.0-0.el6.noarch.rpm
RUN yum clean all && yum -y update

RUN yum -y install make go

COPY . $TARGET
RUN ls $TARGET -al
RUN cd $TARGET && make all && make install

RUN useradd service
RUN mkdir -p /var/local/init-exporter/helpers && mkdir -p /var/log/init-exporter

COPY ./testdata /root

RUN yum clean all && rm -rf /tmp/*

WORKDIR /root
22 changes: 22 additions & 0 deletions Dockerfile.upstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM centos:centos6

ENV GOPATH /root
ENV TARGET /root/src/github.com/funbox/init-exporter

RUN yum install -y http://release.yum.kaos.io/i386/kaos-repo-1.2.0-0.el6.noarch.rpm
RUN yum clean all && yum -y update

RUN yum -y install go

COPY . $TARGET
RUN ls $TARGET -al
RUN cd $TARGET && make all && make install

RUN useradd service
RUN mkdir -p /var/local/init-exporter/helpers && mkdir -p /var/log/init-exporter

COPY ./testdata /root

RUN yum clean all && rm -rf /tmp/*

WORKDIR /root
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2016 FB Group

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
########################################################################################

DESTDIR?=
PREFIX?=/usr

########################################################################################

.PHONY = all clean install uninstall deps deps-glide test

########################################################################################

all: bin

deps:
go get -v pkg.re/check.v1
go get -v pkg.re/essentialkaos/ek.v6
go get -v pkg.re/essentialkaos/go-simpleyaml.v1
go get -v pkg.re/yaml.v2

deps-glide:
glide install

bin:
go build init-exporter.go

fmt:
find . -name "*.go" -exec gofmt -s -w {} \;

test:
go test ./... -covermode=count

install:
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp init-exporter $(DESTDIR)$(PREFIX)/sbin/
cp common/init-exporter.conf $(DESTDIR)/etc/

uninstall:
rm -f $(DESTDIR)$(PREFIX)/sbin/init-exporter
rm -rf $(DESTDIR)/etc/init-exporter.conf

clean:
rm -f init-exporter

upstart-playground:
docker build -f ./Dockerfile.upstart -t upstart-playground . && docker run -ti --rm=true upstart-playground /bin/bash

systemd-playground:
docker build -f ./Dockerfile.systemd -t systemd-playground . && docker run -ti --rm=true systemd-playground /bin/bash
Loading

0 comments on commit c60ad20

Please sign in to comment.