forked from StackStorm/st2chatops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (31 loc) · 860 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
COMPONENT := $(notdir $(CURDIR))
PKG_RELEASE ?= 1
PKG_VERSION ?= $(shell node -e "console.log(require('./package.json').st2_version)")
PREFIX ?= /opt/stackstorm/chatops
ifneq (,$(wildcard /etc/debian_version))
DEBIAN := 1
DESTDIR ?= $(CURDIR)/debian/$(COMPONENT)
else
REDHAT := 1
endif
.PHONY: all build test clean install
all: build
build:
npm install --production
npm cache clean
test:
npm test
clean:
rm -Rf node_modules/
mkdir -p node_modules/
install: changelog
mkdir -p $(DESTDIR)$(PREFIX)
cp -R $(CURDIR)/bin $(DESTDIR)$(PREFIX)/bin
cp -R $(CURDIR)/node_modules $(DESTDIR)$(PREFIX)
cp -R $(CURDIR)/hubot-scripts.json $(DESTDIR)$(PREFIX)
cp -R $(CURDIR)/external-scripts.json $(DESTDIR)$(PREFIX)
cp -R $(CURDIR)/st2chatops.env $(DESTDIR)$(PREFIX)
changelog:
ifeq ($(DEBIAN),1)
debchange -v $(PKG_VERSION)-$(PKG_RELEASE) -M ""
endif