teleport/Makefile

113 lines
3.4 KiB
Makefile
Raw Normal View History

TCD_NODE1 := http://127.0.0.1:4001
ETCD_NODES := ${ETCD_NODE1}
2015-03-02 20:11:23 +00:00
ETCD_FLAGS := TELEPORT_TEST_ETCD_NODES=${ETCD_NODES}
OUT=out
export GO15VENDOREXPERIMENT=1
2015-03-02 20:11:23 +00:00
.PHONY: install test test-with-etcd remove-temp files test-package update test-grep-package cover-package cover-package-with-etcd run profile sloccount set-etcd install-assets docs-serve
configuration: teleport
go test -v github.com/gravitational/teleport/tool/teleport
2016-01-17 18:28:34 +00:00
#
2016-02-02 20:14:59 +00:00
# Default target: builds all 3 executables and plaaces them in a current directory
2016-01-17 18:28:34 +00:00
#
.PHONY: all
all: teleport tctl tsh
2016-02-09 06:29:15 +00:00
.PHONY: tctl
tctl:
go build -o $(OUT)/tctl -i github.com/gravitational/teleport/tool/tctl
.PHONY: teleport
teleport:
rm -rf /var/lib/teleport/assets
cp -r assets/web/assets /var/lib/teleport/
go build -o $(OUT)/teleport -i github.com/gravitational/teleport/tool/teleport
.PHONY: tsh
tsh:
go build -o $(OUT)/tsh -i github.com/gravitational/teleport/tool/tsh
2016-01-17 22:50:00 +00:00
install: remove-temp-files
go install github.com/gravitational/teleport/tool/teleport
go install github.com/gravitational/teleport/tool/tctl
go install github.com/gravitational/teleport/tool/tsh
clean:
rm -rf $(OUT)
2016-01-17 22:50:00 +00:00
#
# this target is used by Jenkins for production builds
#
.PHONY: production
production: clean
$(MAKE) -C build.assets
test: install
go test -v github.com/gravitational/teleport/lib/... -cover
#go test -v -test.parallel=0 $(shell go list ./... | grep -v /vendor/) -cover
2015-03-02 20:11:23 +00:00
test-with-etcd: install
2016-01-20 15:52:25 +00:00
${ETCD_FLAGS} go test -v -test.parallel=0 $(shell go list ./... | grep -v /vendor/) -cover
2015-03-02 20:11:23 +00:00
2015-05-04 15:28:32 +00:00
remove-temp-files:
2015-03-02 20:11:23 +00:00
find . -name flymake_* -delete
2015-12-24 23:24:47 +00:00
test-package: remove-temp-files install
go test -v -test.parallel=0 ./$(p)
2015-03-02 20:11:23 +00:00
2015-12-24 23:24:47 +00:00
test-package-with-etcd: remove-temp-files install
${ETCD_FLAGS} go test -v -test.parallel=0 ./$(p)
2015-03-02 20:11:23 +00:00
2015-12-24 23:24:47 +00:00
test-grep-package: remove-temp-files install
2015-03-02 20:11:23 +00:00
go test -v ./$(p) -check.f=$(e)
2015-05-04 15:28:32 +00:00
cover-package: remove-temp-files
2015-03-02 20:11:23 +00:00
go test -v ./$(p) -coverprofile=/tmp/coverage.out
go tool cover -html=/tmp/coverage.out
2015-05-04 15:28:32 +00:00
cover-package-with-etcd: remove-temp-files
2015-03-02 20:11:23 +00:00
${ETCD_FLAGS} go test -v ./$(p) -coverprofile=/tmp/coverage.out
go tool cover -html=/tmp/coverage.out
pack-teleport: DIR := $(shell mktemp -d)
pack-teleport: pkg teleport
cp assets/build/orbit.manifest.json $(DIR)
mkdir -p $(DIR)/rootfs/usr/bin
2015-10-26 21:36:52 +00:00
mkdir -p $(DIR)/rootfs/usr/bin $(DIR)/rootfs/etc/web-assets/
cp -r ./assets/web/* $(DIR)/rootfs/etc/web-assets/
cp $(GOPATH)/bin/teleport $(DIR)/rootfs/usr/bin
cp $(GOPATH)/bin/tctl $(DIR)/rootfs/usr/bin
2015-11-12 04:25:34 +00:00
gravity package import $(DIR) $(PKG) --check-manifest
rm -rf $(DIR)
pkg:
@if [ "$$PKG" = "" ] ; then echo "ERROR: enter PKG parameter:\n\nmake publish PKG=<name>:<sem-ver>, e.g. teleport:0.0.1\n\n" && exit 255; fi
2015-06-29 02:44:07 +00:00
2015-03-02 20:11:23 +00:00
profile:
go tool pprof http://localhost:6060/debug/pprof/profile
sloccount:
find . -path ./Godeps -prune -o -name "*.go" -print0 | xargs -0 wc -l
2016-01-21 06:29:57 +00:00
#
# Deploy teleport server to staging environment on AWS
2016-01-21 06:29:57 +00:00
# WARNING: this step is called by CI/CD. You must execute make production first
.PHONY: deploy
2016-01-21 06:29:57 +00:00
deploy:
ansible-playbook -i deploy/hosts deploy/deploy.yaml
# Prepare a brand new AWS machine to host Teleport (run provision once,
# then run deploy many times)
.PHONY: provision
provision:
ansible-playbook -i deploy/hosts deploy/provision.yaml
2016-01-17 23:14:04 +00:00
.PHONY: jenkins
jenkins:
curl -X POST -d TARGETENV=staging -d BRANCH=$$(git rev-parse --abbrev-ref HEAD) https://jenkins.gravitational.io/buildByToken/buildWithParameters?job=Teleport&token=ZeeYaeYuTh9quiu8eh3rieChohHoor8aib0oopoov0aewah8