Skip to content

Commit

Permalink
Merge pull request #2 from tomohiro/use-ldflags-to-build
Browse files Browse the repository at this point in the history
Use `ldflags` to build to size down binary
  • Loading branch information
tomohiro authored Dec 10, 2019
2 parents ea98c99 + 41e626f commit 63c6abc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ PACKAGE = $(shell basename $(PWD))
VERSION = $(shell git describe --abbrev=0 --tags)

# Build information
DIST_DIR = $(PWD)/dist
ASSETS_DIR = $(DIST_DIR)/$(VERSION)
XC_OS = "linux darwin"
XC_ARCH = "386 amd64"
DIST_DIR = $(PWD)/dist
ASSETS_DIR = $(DIST_DIR)/$(VERSION)
XC_OS = "linux darwin"
XC_ARCH = "386 amd64"
BUILD_FLAGS = "-w -s"

# Tasks
help:
Expand Down Expand Up @@ -50,7 +51,10 @@ test: deps

dist: deps
@echo "===> Shipping packages as release assets..."
goxz -d $(ASSETS_DIR) -z -os $(XC_OS) -arch $(XC_ARCH)
goxz -d $(ASSETS_DIR) -z -os $(XC_OS) -arch $(XC_ARCH) --build-ldflags=$(BUILD_LDFLAGS)
pushd $(ASSETS_DIR); \
shasum -a 256 *.zip > ./$(VERSION)_SHA256SUMS; \
popd

release:
@echo "===> Publishing release assets to GitHub..."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Installation
Latest release:

```
$ mkr plugin install tomohiro/mackerel-plugin-jitsi-videobridge
$ mkr plugin install mackerel-plugin-jitsi-videobridge
```

Specified release version:

```
$ mkr plugin install tomohiro/[email protected]
$ mkr plugin install [email protected]
```


Expand Down
2 changes: 1 addition & 1 deletion lib/jitsi-videobridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (p JitsiVideobridgePlugin) GraphDefinition() map[string]mp.Graphs {
}
}

// FetchMetrics fetches metrics from Jitsi Videobridge Colibri REST float64erface
// FetchMetrics fetches metrics from Jitsi Videobridge Colibri REST interface
func (p JitsiVideobridgePlugin) FetchMetrics() (map[string]float64, error) {
url := fmt.Sprintf("http://%v:%v/colibri/stats", p.Host, p.Port)
res, err := http.Get(url)
Expand Down

0 comments on commit 63c6abc

Please sign in to comment.