Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
122 lines (95 sloc) 2.67 KB
PKGS := $(shell go list ./... | grep -v 'go.pedge.io/flights/vendor')
all: test
deps:
go get -d -v $(PKGS)
updatedeps:
go get -d -v -u -f $(PKGS)
testdeps:
go get -d -v -t $(PKGS)
updatetestdeps:
go get -d -v -t -u -f $(PKGS)
vendor:
rm -f etc/static/css/bootstrap.min.css
rm -f etc/static/js/jquery.min.js
curl -sSL https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css > etc/static/css/bootstrap.min.css
curl -sSL https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js > etc/static/js/jquery.min.js
go get -u -v github.com/kardianos/govendor
rm -rf vendor
GOOS=linux GOARCH=amd64 go get -d -v -t -u -f ./...
govendor init
GOOS=linux GOARCH=amd64 govendor add +external
GOOS=linux GOARCH=amd64 govendor update +vendor
build:
go build $(PKGS)
install:
go install $(PKGS)
lint:
go get -v github.com/golang/lint/golint
for file in $$(find . -name '*.go' | grep -v 'vendor' | grep -v '\.pb\.go' | grep -v '\.pb\.gw\.go'); do \
golint $${file}; \
if [ -n "$$(golint $${file})" ]; then \
exit 1; \
fi; \
done
vet:
go vet $(PKGS)
errcheck:
go get -v github.com/kisielk/errcheck
errcheck $(PKGS)
pretest: lint vet errcheck
test: pretest
go test $(PKGS)
clean:
go clean -i $(PKGS)
docker-build-flights-dev:
docker build -t quay.io/pedge/flights-dev .
docker-run-flights-dev-internal: install
flightsd
docker-build-flightsd-internal:
rm -rf _tmp
mkdir -p _tmp
CGO_ENABLED=0 go build -a -installsuffix cgo -o _tmp/flightsd cmd/flightsd/main.go
docker build -t quay.io/pedge/flightsd -f Dockerfile.flightsd .
docker-build-flightsd: docker-build-flights-dev
docker run -v /var/run/docker.sock:/var/run/docker.sock quay.io/pedge/flights-dev make docker-build-flightsd-internal
docker-test: docker-build-flights-dev
docker run quay.io/pedge/flights-dev make test
docker-push: docker-build-flightsd
docker push quay.io/pedge/flightsd
docker-dev-launch: docker-build-flights-dev
docker run -d -p 7070:7070 -p 8080:8080 quay.io/pedge/flights-dev
docker-launch: docker-build-flightsd
docker run -d -p 7070:7070 -p 8080:8080 quay.io/pedge/flightsd
launch:
go run cmd/flightsd/main.go
kubernetes-stop:
-kubectl delete service flightsd
-kubectl delete rc flightsd
kubernetes-start: kubernetes-stop
kubectl create -f etc/kubernetes/flightsd.yaml
kubectl describe service flightsd
.PHONY: \
all \
deps \
updatedeps \
testdeps \
updatetestdeps \
vendor \
build \
install \
lint \
vet \
errcheck \
pretest \
test \
clean \
docker-build-flights-dev \
docker-run-flights-dev-internal \
docker-build-flightsd-internal \
docker-build-flightsd \
docker-test \
docker-dev-launch \
docker-launch \
launch \
kubernetes-start \
kubernetes-stop