Skip to content

Commit

Permalink
Add a Makefile targets that installs the config files.
Browse files Browse the repository at this point in the history
This is useful for the new packer.
Look at the bright side: we'll be able to
delete a bunch of the other "install/dist" targets
after it's finished.
  • Loading branch information
Tudor Golubenco committed Aug 6, 2015
1 parent 56d7566 commit d9dccdd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CONF_PATH?=/etc/packetbeat
VERSION?=1.0.0-beta2
ARCH?=$(shell uname -m)
GODEP=$(GOPATH)/bin/godep
PREFIX?=/build

GOFILES = $(shell find . -type f -name '*.go')
packetbeat: $(GOFILES)
Expand Down Expand Up @@ -64,6 +65,18 @@ darwin_dist: packetbeat
tar czvf packetbeat-$(VERSION)-darwin.tgz packetbeat-$(VERSION)-darwin
shasum packetbeat-$(VERSION)-darwin.tgz > packetbeat-$(VERSION)-darwin.tgz.sha1.txt

.PHONY: install_cfg
install_cfg:
cp etc/packetbeat.yml $(PREFIX)/packetbeat-linux.yml
cp etc/packetbeat.template.json $(PREFIX)/packetbeat.template.json
# darwin
cp etc/packetbeat.yml $(PREFIX)/packetbeat-darwin.yml
sed -i .bk 's/device: any/device: en0/' $(PREFIX)/packetbeat-darwin.yml
# win
cp etc/packetbeat.yml $(PREFIX)/packetbeat-win.yml
sed -i .bk 's/device: any/device: 1/' $(PREFIX)/packetbeat-win.yml


.PHONY: gofmt
gofmt:
go fmt ./...
Expand Down

0 comments on commit d9dccdd

Please sign in to comment.