forked from owncloud/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.release
72 lines (56 loc) · 1.51 KB
/
Makefile.release
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
SHELL := /bin/bash
YARN := $(shell command -v yarn 2> /dev/null)
ifndef YARN
$(error yarn is not available on your system, please install npm)
endif
app_name=phoenix
cur_dir=$(CURDIR)
dist_dir=$(CURDIR)/dist
occ=$(CURDIR)/../../occ
private_key=$(HOME)/.owncloud/certificates/$(app_name).key
certificate=$(HOME)/.owncloud/certificates/$(app_name).crt
sign=$(occ) integrity:sign-app --privateKey="$(private_key)" --certificate="$(certificate)"
sign_skip_msg="Skipping signing, either no key and certificate found in $(private_key) and $(certificate) or occ can not be found at $(occ)"
ifneq (,$(wildcard $(private_key)))
ifneq (,$(wildcard $(certificate)))
ifneq (,$(wildcard $(occ)))
CAN_SIGN=true
endif
endif
endif
.DEFAULT_GOAL := help
help:
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
##
## Build targets
##--------------------------------------
.PHONY: dist
dist: ## Build distribution
dist: distdir javascript oc-app distconf sign package
.PHONY: javascript
javascript:
$(YARN) install
$(YARN) dist
.PHONY: distdir
distdir:
rm -rf $(dist_dir)
.PHONY: distconf
distconf:
cp config.json.dist $(dist_dir)/config.json
.PHONY: oc-app
oc-app:
cp -R appinfo $(dist_dir)
cp -R img $(dist_dir)
cp .htaccess $(dist_dir)
.PHONY: sign
sign:
ifdef CAN_SIGN
$(sign) --path="$(dist_dir)"
else
@echo $(sign_skip_msg)
endif
.PHONY: package
package:
rm -rf $(CURDIR)/release
mkdir $(CURDIR)/release
cd $(dist_dir) && tar -czf $(cur_dir)/release/$(app_name).tar.gz *