Commit cfed5df11564218b9c2f37f250141f8699ca5700
1 parent
edd2fc8c
Exists in
master
Adiciona configuração automática do angular na instalação
Showing
1 changed file
with
17 additions
and
3 deletions
Show diff stats
Makefile
1 | -INSTALLDIR=/var/www | |
1 | +INSTALLDIR = /var/www | |
2 | +SED_REPLACE_ALL = sed -i "s/$(1)/$(2)/g" "$(3)" | |
3 | +SED_REPLACE_ALL_PATH = sed -i "s\#$(1)\#$(2)\#g" "$(3)" | |
4 | +ifndef IP | |
5 | + ifneq ($(shell ip route | grep "default" | awk '{print $$5; exit}'),) | |
6 | + IP := $(shell ip route get 1 | awk '{print $$7; exit}') | |
7 | + else | |
8 | + IP := 127.0.0.1 | |
9 | + endif | |
10 | +endif | |
11 | +LOCALHOST ?= ${IP} | |
2 | 12 | |
3 | 13 | D=$(shell find * -type d -print) |
4 | 14 | F=$(shell find * -type f -not -iname "Makefile" -not -iname "README.md" -print) |
5 | 15 | |
6 | -.PHONY: install uninstall | |
7 | - | |
8 | 16 | install: |
17 | + @ cp ./conf/app-conf.json.template ./conf/app-conf.json | |
18 | + @ $(call SED_REPLACE_ALL_PATH,<pybossa-base-url>,http://${LOCALHOST}/pybossa,./conf/app-conf.json) | |
19 | + @ $(call SED_REPLACE_ALL_PATH,<wikilibras-api-base-url>,http://${LOCALHOST}:201,./conf/app-conf.json) | |
20 | + @ $(call SED_REPLACE_ALL_PATH,<db-api-base-url>,http://${LOCALHOST}:200,./conf/app-conf.json) | |
9 | 21 | @ for d in ${D}; do sudo $(addprefix install -m 775 -p -v -d ${INSTALLDIR}/,$$d); done |
10 | 22 | @ for f in ${F}; do sudo $(addprefix install -m 644 -p -v $$f ${INSTALLDIR}/,$$f); done |
11 | 23 | |
12 | 24 | uninstall: |
13 | 25 | @ for f in ${F}; do sudo $(addprefix rm -fv ${INSTALLDIR}/,$$f); done |
14 | 26 | @ if [ -d "${INSTALLDIR}" ]; then sudo find ${INSTALLDIR} -type d -empty -print -delete; fi |
27 | + | |
28 | +.PHONY: install uninstall | ... | ... |