Skip to content

Commit

Permalink
Add Makefile (#1867)
Browse files Browse the repository at this point in the history
* Generate badges only that are required on a page

* Fix codacy

* Add Makefile and honcho to start devlopment server and app with a single make command!

* Add honcho in dependencies

* Add bower install command

* Add make test for frontend tests
  • Loading branch information
rupav authored and ParthS007 committed Dec 12, 2018
1 parent f4a31ea commit f6373b5
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
49 changes: 49 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
-include .env

BASEDIR = $(realpath .)

API = $(BASEDIR)/api
FRONTEND = $(BASEDIR)/frontend

VIRTUALENV = $(VIRTUAL_ENV)

NODE_MODULES = $(FRONTEND)/node_modules
NODEBINARIES = $(NODE_MODULES)/.bin

PYBINARIES = $(VIRTUALENV)/bin
PYTHON = $(PYBINARIES)/python
PIP = $(PYBINARIES)/pip
HONCHO = $(PYBINARIES)/honcho

NPM ?= npm
BOWER ?= bower

clean.frontend:
rm -rf $(NODE_MODULES)

clean:
make clean.frontend

install:
$(PIP) install --ignore-installed -r $(API)/requirements.txt
$(NPM) --prefix $(FRONTEND) install
$(BOWER) install --config.cwd=$(FRONTEND)

test:
$(NPM) --prefix $(FRONTEND) test
$(NPM) --prefix $(FRONTEND) test --server

lock:
# Lock Dependencies

rm $(API)/requirements.txt
$(PIP) freeze > $(API)/requirements.txt

upgrade:
$(npm) --prefix $(FRONTEND) upgrade

build:
$(NPM) --prefix $(FRONTEND) build

start:
$(HONCHO) start --procfile $(BASEDIR)/Procfile.dev
2 changes: 2 additions & 0 deletions Procfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: gunicorn --pythonpath api/ run:app
node: npm --prefix frontend/ start
1 change: 1 addition & 0 deletions api/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ google-cloud-storage==1.9.0
google-resumable-media==0.3.1
googleapis-common-protos==1.5.3
gunicorn==19.7.1
honcho==1.0.1
idna==2.6
itsdangerous==0.24
Jinja2==2.10
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"build": "ember build",
"lint:js": "eslint ./*.js app config lib server tests",
"start": "ember serve",
"start": "ember serve --port=4200",
"test": "ember test"
},
"devDependencies": {
Expand Down

0 comments on commit f6373b5

Please sign in to comment.