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 85dcfcb6d53e6ea048571f260ffdcd87e8095b8b 1 parent 0c20c8f
@suhailshergill authored
Showing with 15 additions and 7 deletions.
  1. +15 −7 blog/Makefile
View
22 blog/Makefile
@@ -6,6 +6,7 @@ v = 1
prefix = $(root)
bindir = $(prefix)/bin
+deploydir = $(HOME)/workspace
blogInitd = /etc/init.d/blog
root = $(realpath $(CURDIR)/../..)
@@ -14,12 +15,13 @@ stdout = /dev/null
stderr = $(logDir)/stderr.log
logFiles = $(stderr) blog.prof blog.summary
-launcherFile= $(root)/bin/blog-launcher
+launcherFile= $(bindir)/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,18 @@ 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 = upx -d `$(WHICH) $(1)`; $(INSTALL) `$(WHICH) $(1)` $(bindir);
+install: blog-launcher
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.