-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build debs and rpms for general linux (#44)
* WIP - fpm for deb + rpm * Add zip extension to zipfile * Cut 1.0.0 * Some fixes * Use usr/sbin/goat * Add environment variables GOAT_LOG_LEVEL and GOAT_TAG_PREFIX
- Loading branch information
Showing
7 changed files
with
97 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
bin/ | ||
rpm-package/goat | ||
goat | ||
pkg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
NAME:=goat | ||
VERSION:=0.9.0 | ||
VERSION:=1.0.0 | ||
OS:=linux | ||
ARCH:=amd64 | ||
GOAT_FILES?=$$(find . -name '*.go' | grep -v vendor) | ||
BINPATH=usr/sbin | ||
|
||
all: build | ||
|
||
build: deps | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w -extldflags "-static" -X main.VERSION=$(VERSION)' -o bin/$(NAME) | ||
strip bin/$(NAME) | ||
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -a -tags netgo -ldflags '-w -extldflags "-static" -X main.VERSION=$(VERSION)' -o $(BINPATH)/$(NAME) | ||
strip $(BINPATH)/$(NAME) | ||
|
||
test: | ||
@go vet ./... | ||
|
@@ -22,18 +25,35 @@ fmt: | |
lint: | ||
-gometalinter.v2 --enable-all $(GOAT_FILES) --exclude=_test.go | ||
|
||
package_all: pkgclean build deb rpm zip | ||
|
||
zip: | ||
@zip pkg/$(NAME)_$(VERSION)_$(OS)_$(ARCH).zip -j $(BINPATH)/$(NAME) | ||
|
||
deb: | ||
@mkdir -p pkg | ||
fpm -s dir -t deb -n $(NAME) -v $(VERSION) -C . \ | ||
-p pkg/$(NAME)_VERSION_ARCH.deb \ | ||
-d "mdadm" \ | ||
--deb-systemd ./[email protected] \ | ||
$(BINPATH) | ||
|
||
rpm: | ||
@mkdir -p pkg | ||
fpm -s dir -t rpm -n $(NAME) -v $(VERSION) -C . \ | ||
-p pkg/$(NAME)_VERSION_ARCH.rpm \ | ||
-d "mdadm" \ | ||
--rpm-systemd ./[email protected] \ | ||
$(BINPATH) | ||
|
||
pkgclean: | ||
@rm -rf pkg | ||
|
||
lintsetup: | ||
@go get -u gopkg.in/alecthomas/gometalinter.v2 | ||
@gometalinter.v2 --install 2>&1 >/dev/null | ||
@go install ./... | ||
|
||
clean: | ||
-rm -rf bin | ||
|
||
rpm: build | ||
@cp bin/goat rpm-package/ | ||
GOAT_VERSION=$(VERSION) $(MAKE) -C ./rpm-package/ | ||
|
||
dev-env: ## Build a local development environment using Docker | ||
@docker run -it --rm \ | ||
-v $(shell pwd):/go/src/github.com/sevagh/$(NAME) \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.