This repository has been archived by the owner on Mar 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
63 lines (47 loc) · 1.45 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
# Reusable Makefile
# ------------------------------------------------------------------------
# This section of the Makefile should not be modified, it includes
# commands from my reusable Makefile: https://github.com/rowanmanning/make
-include node_modules/@rowanmanning/make/javascript/index.mk
# [edit below this line]
# ------------------------------------------------------------------------
# Running tasks
# -------------
# Start the application in production mode
start:
@NODE_ENV=production node index.js
# Start the application in development mode and auto-restart
# whenever code changes
start-dev:
@NODE_ENV=development nodemon -e dust,js,json index.js
# Configuration tasks
# -------------------
# Configure the application for local development
config: .env
# Duplicate the sample environment variable file
.env:
@echo "Creating .env file from env.sample"
@cp ./env.sample ./.env;
@$(TASK_DONE)
# Database tasks
# --------------
# Create the local development database
db-create:
@psql -c "CREATE DATABASE pa11y_sidekick"
@$(TASK_DONE)
# Create the local automated testing database
db-create-test:
@psql -c "CREATE DATABASE pa11y_sidekick_test"
@$(TASK_DONE)
# Migrate to the latest version of the database schema
db-migrate-up:
@./script/migrate-up.js
@$(TASK_DONE)
# Roll back the most recent migration
db-migrate-down:
@./script/migrate-down.js
@$(TASK_DONE)
# Seed the database with some demo data
db-seed:
@./script/seed.js
@$(TASK_DONE)