-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (52 loc) · 1.6 KB
/
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
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
SHELL := /bin/bash
VENV := .venv
DOCSOURCE := Documentation
SERVERDIR := server
DOCGENERTD := $(SERVERDIR)/docs
AGENTDIR := agent
include Version
.PHONY: build_docs build_server all clean
all: build_docs build_server build_agent
build_docs: |$(VENV)
ifdef publish
$(eval action := gh-deploy)
else
$(eval action := build)
endif
# set the Version in the About page
sed "s/<version>/$(VERSION).$(RELEASE)/" \
< $(DOCSOURCE)/docs/about.md_template > $(DOCSOURCE)/docs/about.md
@source $(VENV)/bin/activate && cd $(DOCSOURCE) && mkdocs $(action)
@rm -rf $(DOCGENERTD) && mv $(DOCSOURCE)/site $(DOCGENERTD) && \
echo "Documentation generated in $(DOCGENERTD)/"
@rm -rf $(DOCSOURCE)/docs/about.md
publish_docs:
@$(MAKE) build_docs publish=ok
$(VENV):
echo "*** Create the mkdocs enviroment"
python -m venv $@
source $@/bin/activate && pip install mkdocs
$(SERVERDIR)/node_modules:
echo "*** Download the Node.js dependencies of the Server"
cd $(SERVERDIR) && npm install
build_server: |$(SERVERDIR)/node_modules
mkdir -p packages/BUILD
cp -r server/* packages/BUILD
rpmbuild -D="_topdir $${PWD}/packages" \
-D='_version $(VERSION)' \
-D='_release $(RELEASE)' \
-bb chaos-bonobo-server.spec
find packages/RPMS -name '*.rpm' | xargs -i mv '{}' .
rm -rf packages
build_agent:
mkdir -p packages/BUILD
cp -r $(AGENTDIR)/* packages/BUILD
rpmbuild -D="_topdir $${PWD}/packages" \
-D='_version $(VERSION)' \
-D='_release $(RELEASE)' \
-bb chaos-bonobo-agent.spec
find packages/RPMS -name '*.rpm' | xargs -i mv '{}' .
rm -rf packages
clean:
rm -rf *.rpm
rm -rf $(DOCGENERTD)