Skip to content

Commit b10854a

Browse files
committed
Merge pull request #6 from mackerelio/packaging-preparation
Packaging preparation
2 parents f8d5a42 + 19f67d0 commit b10854a

File tree

14 files changed

+644
-2
lines changed

14 files changed

+644
-2
lines changed

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,31 @@ language: go
22
go:
33
- 1.4
44
env: PATH=/home/travis/gopath/bin:$PATH
5+
install:
6+
- go get github.com/mitchellh/gox
7+
- gox -build-toolchain -osarch=linux/386
8+
- sudo apt-get update
9+
- DEBIAN_FRONTEND=noninteractive sudo apt-get install -y rpm devscripts debhelper
10+
- mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
511
script:
612
- make lint
713
- make cover
14+
- make all
815
after_script:
916
- goveralls -coverprofile=.profile.cov
17+
after_success:
18+
- tool/travis/autotag.sh
19+
deploy:
20+
provider: releases
21+
api_key:
22+
secure: vmMQz+IjJ/LUa9SHAlLKyg4raSqkEBIRzqnjS1LK7ZjtcAROo6Pn0lUcC4qMZ96/VvNMdLyGndCOBXsdE2VBCY5goTI7uIW1oxbLM3qOMNQQldG1bOY34bjkiiDU15WLUsKKPEC2RdgwG1aAAsqcUDAeyRABYVBANSn9jylQnBC2b2mQMYUtVA1O9jl3Qg64Cy6MUUirE/SuKp/cnE3AakcQt54pNVsnM54bIyrbGhqThLj7p7uLJEm58oRWR7TTUSgmk/Rbj4aJSC4k5lzN9iL/Fr5AgnpEQQUg3ishE+5yqSW7f/PRqXC6ZI9p6XS7bhS8N178ImzouIsoKWltblsgUhfvE6ONyMpi1+RG+6Lp3HlpLuq0Pz/efEpcaSDg6lXDIvMBC2sA5pbPok6Yx4tJOSv8adWu9t0yGVJezYaqbN/071K9m3cM4YTQK4L39b2FxQ2ZrUhee8HZy5rDO8iqx2vgM+NXATz2L5Tjjzd4aqfIDX8R3PVImBci7se/wmamDUpOrcfSjrI2dzEQGBzBfIFIhCaCQSuEjpZqBKdcOztkn1uev7a0AAUeZ7my+uQNpAMO7/AapM7LLugmkLM06FgrHKWDPQP/T92MPyvmC04nNraetAVijVYLQnlK5+TdEMvkKHuY5afLp5mEzX+7jTSmjyaUNrbANs8bH/8=
23+
file:
24+
- "/home/travis/rpmbuild/RPMS/noarch/mackerel-check-plugins-0.0.0-1.noarch.rpm"
25+
- "/home/travis/gopath/src/github.com/mackerelio/go-check-plugins/packaging/mackerel-check-plugins_0.0.0-1_all.deb"
26+
on:
27+
repo: mackerelio/go-check-plugins
28+
all_branches: true
29+
tags: true
30+
notifications:
31+
slack:
32+
secure: gsM+oW5k6hQnL16ubkj0Iu7b3kSeUUGCErwWa8AIBdfk6DUYBxfFNkJkHJ+N44YJPuk/ijaTk8fzQ0HqD9H+Fegkv/KPMnJ00QxOD4XWv4URFACuGQgC2xB4G8OBg7StHPN68KroQn1ryNNoAwiZih///PGJyxb4uU/FrpA8iLATBoGoaEv8OrGkkwIepvtuHeRzyMPAjNvNO6evI0d/+Xn0YLRLtufdznHG3UHc/FJ306QkMz5hbP4iZqyNFlj6sFlvvovsozTqgGYYqKz2QbMzvR3l7xuFWiV6qa6zegy6sWp9pBWykQMm528R3pVDSu/f775shORLS4DaSV7ZM3Gw963gIgfdmcqLi6KP8j+NqqyveUAq5C6JOaVDTKwJg+b2yL6TYYEQ4Lz7WiOLLmjj9V+9+i5oy852FfQEG/en9+jnPDuWDI0ILKTW8EqcQfCf46mtV0TiWY4if5iYAVUOl2O5Jam9LTX9YSeRA0qq9022tJ60GpIvX9vskO2SXTdAAQRRqM5dliOYblo0H3AmBQWTixH+AgcOP0nzAugIRX07Kpni9GfOL5bW3lBVJo1502DZWLdKoF1ulS/nHfWdz9TwuocX8hOko/H3yNH8Lt9DyodgXgWDwtYuHeuXxw7gTcaPX4K3wGgshnaBZXrryWH6u7UPT8hFePqsD58=

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 0.0.0 (2015-10-07)
4+
5+
* Initial release

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
TARGET_OSARCH="linux/386"
22

3-
all: clean test build
3+
all: clean test build rpm deb
44

55
test: lint
66
go test $(TESTFLAGS) ./...
@@ -27,15 +27,26 @@ cover: devel-deps
2727
build: deps
2828
mkdir -p build
2929
for i in check-*; do \
30+
if [ $$i = check-load ]; then \
31+
echo ""; \
32+
else \
3033
gox -osarch=$(TARGET_OSARCH) -output build/$$i \
3134
github.com/mackerelio/go-check-plugins/$$i; \
35+
fi; \
3236
done
3337

38+
rpm: build
39+
rpmbuild --define "_sourcedir `pwd`" -ba packaging/rpm/mackerel-check-plugins.spec
40+
41+
deb: build
42+
cp build/check-* packaging/deb/debian/
43+
cd packaging/deb && debuild --no-tgz-check -rfakeroot -uc -us
44+
3445
clean:
3546
if [ -d build ]; then \
3647
rm -f build/check-*; \
3748
rmdir build; \
3849
fi
3950
go clean
4051

41-
.PHONY: all test deps devel-deps lint cover build clean
52+
.PHONY: all test deps devel-deps lint cover build clean rpm deb

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ go-check-plugins
33

44
Check Plugins for monitoring written in golang.
55

6+
7+
Documentation for each plugin is located in its respective sub directory.
8+
9+
* [check-file-age](./check-file-age/README.md)
10+
* [check-http](./check-http/README.md)
11+
* [check-load](./check-load/README.md)
12+
* [check-procs](./check-procs/README.md)
13+
614
Specification
715
-------------
816

@@ -14,3 +22,11 @@ The specs for the check plugins are mostly the same as the [Nagios](https://www.
1422
| 1 | WARNING |
1523
| 2 | CRITICAL |
1624
| other than 0,1, or 2 | UNKNOWN |
25+
26+
27+
Contribution
28+
------------
29+
30+
* fork it
31+
* develop the plugin you want
32+
* create a pullrequest!

packaging/config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"description": "configuration for packaging mackerel-check-plugins",
3+
"plugins": [
4+
"file-age",
5+
"http",
6+
"load",
7+
"procs"
8+
]
9+
}

packaging/deb/debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mackerel-check-plugins (0.0.0-1) unstable; urgency=low
2+
3+
* Initial release
4+
5+
-- itchyny <[email protected]> Wed, 7 Oct 2015 12:00:00 +0900

packaging/deb/debian/control

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Source: mackerel-check-plugins
2+
Maintainer: Shinji Tanaka <[email protected]>
3+
Section: misc
4+
Priority: optional
5+
Standards-Version: 0.0.0
6+
7+
Package: mackerel-check-plugins
8+
Architecture: all
9+
Description: macekrel.io check plugins

packaging/deb/debian/copyright

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Apache2

packaging/deb/debian/rules

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/make -f
2+
3+
%:
4+
dh $@
5+
6+
package=mackerel-check-plugins
7+
8+
override_dh_auto_install:
9+
dh_auto_install
10+
install -d -m 755 debian/tmp/usr/local/bin
11+
for i in http file-age procs;do \
12+
install -m755 debian/check-$$i debian/tmp/usr/local/bin; \
13+
done
14+
15+
override_dh_usrlocal:
16+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
%define _binaries_in_noarch_packages_terminate_build 0
2+
%define _localbindir /usr/local/bin
3+
%define __targetdir /usr/local/bin
4+
5+
Name: mackerel-check-plugins
6+
Version: 0.0.0
7+
Release: 1
8+
License: Commercial
9+
Summary: macekrel.io check plugins
10+
URL: https://mackerel.io
11+
Group: Hatena
12+
Packager: Hatena
13+
BuildArch: noarch
14+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
15+
16+
%description
17+
mackerel.io check plugins
18+
19+
%prep
20+
21+
%build
22+
23+
%install
24+
%{__rm} -rf %{buildroot}
25+
26+
%{__mkdir} -p %{buildroot}%{__targetdir}
27+
28+
for i in http file-age procs;do \
29+
%{__install} -m0755 %{_sourcedir}/build/check-$i %{buildroot}%{__targetdir}/; \
30+
done
31+
32+
%clean
33+
%{__rm} -rf %{buildroot}
34+
35+
%files
36+
%defattr(-, root, root, 0755)
37+
%{__targetdir}
38+
39+
%changelog
40+
* Wed Oct 7 2015 itchyny <[email protected]> 0.0.0
41+
- Initial release

0 commit comments

Comments
 (0)