2015-07-15 00:52:12 +00:00
|
|
|
TCD_NODE1 := http://127.0.0.1:4001
|
2015-05-07 03:10:44 +00:00
|
|
|
ETCD_NODES := ${ETCD_NODE1}
|
2015-03-02 20:11:23 +00:00
|
|
|
ETCD_FLAGS := TELEPORT_TEST_ETCD_NODES=${ETCD_NODES}
|
2016-02-09 23:05:02 +00:00
|
|
|
OUT=out
|
2016-01-21 03:17:29 +00:00
|
|
|
export GO15VENDOREXPERIMENT=1
|
2015-03-02 20:11:23 +00:00
|
|
|
|
2016-02-10 00:09:21 +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
|
2015-10-13 00:50:36 +00:00
|
|
|
|
2016-02-16 06:08:14 +00:00
|
|
|
configuration: teleport
|
|
|
|
go test -v github.com/gravitational/teleport/tool/teleport
|
2016-02-13 22:38:22 +00:00
|
|
|
|
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
|
|
|
#
|
2016-02-14 01:09:05 +00:00
|
|
|
.PHONY: all
|
|
|
|
all: teleport tctl tsh
|
|
|
|
|
2016-02-09 06:29:15 +00:00
|
|
|
.PHONY: tctl
|
|
|
|
tctl:
|
2016-02-09 23:05:02 +00:00
|
|
|
go build -o $(OUT)/tctl -i github.com/gravitational/teleport/tool/tctl
|
2016-02-08 22:51:22 +00:00
|
|
|
|
2016-02-10 00:09:21 +00:00
|
|
|
.PHONY: teleport
|
|
|
|
teleport:
|
2016-02-10 02:28:38 +00:00
|
|
|
rm -rf /var/lib/teleport/assets
|
|
|
|
cp -r assets/web/assets /var/lib/teleport/
|
2016-02-09 23:05:02 +00:00
|
|
|
go build -o $(OUT)/teleport -i github.com/gravitational/teleport/tool/teleport
|
2016-02-10 00:09:21 +00:00
|
|
|
|
|
|
|
.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:
|
2016-02-14 01:09:05 +00:00
|
|
|
rm -rf $(OUT)
|
2016-01-17 22:50:00 +00:00
|
|
|
|
2016-01-19 23:55:49 +00:00
|
|
|
#
|
|
|
|
# this target is used by Jenkins for production builds
|
|
|
|
#
|
|
|
|
.PHONY: production
|
2016-01-20 23:46:47 +00:00
|
|
|
production: clean
|
2016-01-19 23:55:49 +00:00
|
|
|
$(MAKE) -C build.assets
|
|
|
|
|
|
|
|
|
2015-09-02 21:51:52 +00:00
|
|
|
test: install
|
2016-02-13 23:36:22 +00:00
|
|
|
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
|
|
|
|
2015-09-02 21:51:52 +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
|
2015-08-26 15:31:34 +00:00
|
|
|
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
|
2015-08-26 15:31:34 +00:00
|
|
|
${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
|
|
|
|
|
2015-10-13 00:50:36 +00:00
|
|
|
pack-teleport: DIR := $(shell mktemp -d)
|
|
|
|
pack-teleport: pkg teleport
|
2015-10-25 21:48:03 +00:00
|
|
|
cp assets/build/orbit.manifest.json $(DIR)
|
2015-10-13 00:50:36 +00:00
|
|
|
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/
|
2015-10-13 00:50:36 +00:00
|
|
|
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
|
2015-10-13 00:50:36 +00:00
|
|
|
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-22 21:05:15 +00:00
|
|
|
|
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
|
2015-05-14 01:40:39 +00:00
|
|
|
|
2016-01-21 06:29:57 +00:00
|
|
|
#
|
2016-01-17 03:56:20 +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
|
2016-01-17 03:56:20 +00:00
|
|
|
.PHONY: deploy
|
2016-01-21 06:29:57 +00:00
|
|
|
deploy:
|
2016-01-17 03:56:20 +00:00
|
|
|
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
|