-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
47 lines (40 loc) · 1.07 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
clean:
@echo "Cleaning up build and *.pyc files..."
@find . -name '*.pyc' -exec rm -rf {} \;
@rm -rf build
db: drop_db create_db migrate_db
db_test:
@make drop_db create_db migrate_db migrate_db_down
@make migrate_db
drop_db:
@echo -n $(red)
@echo "Dropping database..."
@echo -n $(white)
@mysql -u root -e 'DROP DATABASE IF EXISTS nginx_monitor;'
@echo -n $(normal)
create_db:
@echo "Creating database..."
@echo -n $(white)
@mysql -u root -e 'CREATE DATABASE IF NOT EXISTS nginx_monitor;'
@echo -n $(green)
@echo 'Database `nginx_monitor` created!'
@echo -n $(normal)
migrate_db:
@echo "Migrating nginx_monitor"
@echo -n $(white)
@db-migrate -c migrations/local.conf
@echo -n $(green)
@echo "Database migrated!"
@echo -n $(green)
@echo "DONE"
@echo -n $(normal)
migrate_db_down:
@echo "Migrating down to test migrations..."
@echo -n $(white)
@db-migrate -c migrations/local.conf -m 20091022185400
@echo -n $(green)
@echo "DONE"
@echo -n $(normal)
start:
@echo "Running nginx-monitor-server http://localhost:8080..."
@cd nmonitor && python start.py start