Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

build: split install into deploy + install

'make deploy' is run in vm

the output of that is then transferred to the server (this is currently
manual, till i figure out how i want to handle this)

'make install' is then run on the server
  • Loading branch information...
commit 6e2c7b60051cd24c296e0478fe60818f47b550bf 1 parent 0c20c8f
@suhailshergill authored
Showing with 17 additions and 6 deletions.
  1. +17 −6 blog/Makefile
View
23 blog/Makefile
@@ -6,6 +6,7 @@ v = 1
prefix = $(root)
bindir = $(prefix)/bin
+deploydir = $(HOME)/workspace
blogInitd = /etc/init.d/blog
root = $(realpath $(CURDIR)/../..)
@@ -17,9 +18,10 @@ logFiles = $(stderr) blog.prof blog.summary
launcherFile= $(root)/bin/blog-launcher
RTSOPTS = $(GHCRTS) +RTS -pa -sblog.summary -xc -RTS
define launcherContent
-#! /bin/sh
-pwd
-exec $(bindir)/blog $(RTSOPTS) $$@ 1> /dev/null 2> $(stderr)
+#!/bin/sh
+#pwd
+#exec $(bindir)/blog $(RTSOPTS) $$@ 1> /dev/null 2> $(stderr)
+exec $(bindir)/blog $$@ 1> /dev/null 2> $(stderr)
endef
export launcherContent
@@ -52,12 +54,21 @@ clean:
doc:
#haskdogs -e
-.PHONY: install
-install: blog blog-launcher
+.PHONY: deploy
+deployBin = $(INSTALL) `$(WHICH) $(1)` $(deploydir); upx $(deploydir)/$(1);
+deploy: blog
cabal install
+ $(call map,deployBin,blog publish-entry)
+
+.PHONY: install
+installBin = $(INSTALL) `$(WHICH) $(1)` $(bindir);
+install: blog-launcher
+ upx -d `$(WHICH) blog`
+ upx -d `$(WHICH) publish-entry`
+ $(INSTALL) $(launcherFile) $(bindir)
sudo $(blogInitd) stop
$(call map,rotateLog,$(logFiles))
- $(INSTALL) `$(WHICH) blog` $(bindir)
+ $(call map,installBin,blog publish-entry)
sudo $(blogInitd) start
@sleep 5
$(MAKE) error-file
Please sign in to comment.
Something went wrong with that request. Please try again.