-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·47 lines (34 loc) · 1.55 KB
/
Makefile
File metadata and controls
executable file
·47 lines (34 loc) · 1.55 KB
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
ZIP_NAME ?= "monitoringEndpoint.zip"
PLUGIN_NAME = monitoring-endpoint
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
all: build zip ## build and zip
build: clean buildinfojson ## build plugin
npm install flatted
npm install https
mkdir -p build
mkdir -p build/$(PLUGIN_NAME)
mkdir -p build/$(PLUGIN_NAME)/webfrontend
mkdir -p build/$(PLUGIN_NAME)/l10n
mkdir -p build/$(PLUGIN_NAME)/server
mkdir -p build/$(PLUGIN_NAME)/server/extension
cp src/server/extension/monitoring-endpoint.js build/$(PLUGIN_NAME)/server/extension/monitoring-endpoint.js
cp l10n/monitoring-endpoint.csv build/$(PLUGIN_NAME)/l10n/monitoring-endpoint.csv # copy l10n
cp -r node_modules build/$(PLUGIN_NAME)/
cp manifest.master.yml build/$(PLUGIN_NAME)/manifest.yml # copy manifest
cp build-info.json build/$(PLUGIN_NAME)/build-info.json
buildinfojson:
repo=`git remote get-url origin | sed -e 's/\.git$$//' -e 's#.*[/\\]##'` ;\
rev=`git show --no-patch --format=%H` ;\
lastchanged=`git show --no-patch --format=%ad --date=format:%Y-%m-%dT%T%z` ;\
builddate=`date +"%Y-%m-%dT%T%z"` ;\
echo '{' > build-info.json ;\
echo ' "repository": "'$$repo'",' >> build-info.json ;\
echo ' "rev": "'$$rev'",' >> build-info.json ;\
echo ' "lastchanged": "'$$lastchanged'",' >> build-info.json ;\
echo ' "builddate": "'$$builddate'"' >> build-info.json ;\
echo '}' >> build-info.json
clean: ## clean
rm -rf build
zip: build ## zip file
cd build && zip ${ZIP_NAME} -r $(PLUGIN_NAME)/