aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-12 12:01:45 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-12 12:17:15 +0200
commitda0cbb7d379fd5440993223094976d76f7b06f58 (patch)
tree856d69d5b9972698f6cfc6fa8bb87b4ffa69fad5
parent44ee4a9ef435de2a5b6a26199b0b17e33eedb6ca (diff)
Add install rule
Installation directory can be changed using INSTALL_DIR and INSTALL_WEBAPP_DIR env variables Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
-rw-r--r--Makefile25
1 files changed, 10 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index b6c8a30..5fb3204 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,13 @@ ifeq ($(origin VERSION), undefined)
endif
endif
+# Configurable variables for installation (default /usr/local/...)
+ifeq ($(origin INSTALL_DIR), undefined)
+ INSTALL_DIR := /usr/local/bin
+endif
+ifeq ($(origin INSTALL_WEBAPP_DIR), undefined)
+ INSTALL_WEBAPP_DIR := ${INSTALL_DIR}/xds-server-www
+endif
HOST_GOOS=$(shell go env GOOS)
HOST_GOARCH=$(shell go env GOARCH)
@@ -76,21 +83,9 @@ webapp/install:
(cd webapp && npm install)
-# FIXME - package webapp
-release: releasetar
- goxc -d ./release -tasks-=go-vet,go-test -os="linux darwin" -pv=$(VERSION) -arch="386 amd64 arm arm64" -build-ldflags="-X main.AppVersionGitTag=$(VERSION)" -resources-include="README.md,Documentation,LICENSE,contrib" -main-dirs-exclude="vendor"
-
-releasetar:
- mkdir -p release/$(VERSION)
- glide install --strip-vcs --strip-vendor --update-vendored --delete
- glide-vc --only-code --no-tests --keep="**/*.json.in"
- git ls-files > /tmp/xds-server-build
- find vendor >> /tmp/xds-server-build
- find webapp/ -path webapp/node_modules -prune -o -print >> /tmp/xds-server-build
- tar -cvf release/$(VERSION)/xds-server_$(VERSION)_src.tar -T /tmp/xds-server-build --transform 's,^,xds-server_$(VERSION)/,'
- rm /tmp/xds-server-build
- gzip release/$(VERSION)/xds-server_$(VERSION)_src.tar
-
+install: all
+ mkdir -p ${INSTALL_DIR} && cp bin/xds-server ${INSTALL_DIR}
+ mkdir -p ${INSTALL_WEBAPP_DIR} && cp -a webapp/dist/* ${INSTALL_WEBAPP_DIR}
vendor: tools/glide glide.yaml
./tools/glide install --strip-vendor