This repository has been archived by the owner on Sep 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
103 lines (71 loc) · 2.48 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
SHELL := /bin/bash
PATH := node_modules/.bin:$(PATH)
# python3 and pip3 are required
PYTHON = python3
PIP = pip3
TOUCH := /usr/bin/touch
env ?= development
ifeq ($(env),production)
NODE_ENV ?= production
else ifeq ($(env),staging)
NODE_ENV ?= production
else
NODE_ENV ?= development
endif
CLI_IXT_BLUE = \033[38;5;67m
CLI_SUCCESS = \033[1;32m✔
CLI_ERROR = \033[1;31m✘
CLI_NOTICE = \033[1;36m→
CLI_RESET = \033[0m
.PHONY: all server build deploy clean clobber install pythonsetup data clean-js-search-cache clean-shs-search-cache clean-shs-scrape-cache test-shs-api
all: server
# Dependencies
install: Makefile node_modules pythonsetup
node_modules: package.json
npm install
$(TOUCH) $@
pythonsetup:
@$(PIP) install requests beautifulsoup4
setup: install
@echo "No environment setup needed"
update: install
@echo "No environment update needed"
server: install
NODE_ENV=$(NODE_ENV) $$(npm bin)/nodemon -q -i src -i data -i prototypes -i build script/server.js
build: clean node_modules
NODE_ENV=$(NODE_ENV) $$(npm bin)/webpack --colors --progress
clean:
rm -rf build
clobber: clean
rm -rf node_modules
# Data
# the data-processing pipeline
data/out/songs.csv:
wget -O data/out/songs.csv https://docs.google.com/spreadsheets/d/1EqO6oF0o8oL0XLcNXNkdOA4wbcKJBiTb24rBphubgrA/export?format=csv
data/out/guardian_songs.csv:
wget -O data/out/guardian_songs.csv https://docs.google.com/spreadsheets/d/1vIkPwZaE58TbgoPpCQvMLvSvPfs068m1pIetNvElCr4/export?format=csv
data/out/songinfo.json: data/out/guardian_songs.csv
$(PYTHON) data/py/pullData.py
data/out/songinfo-spotify.json: data/out/songinfo.json
node data/js/spotify.js
data/out/songinfo-spotify-echonest.json: data/out/songinfo-spotify.json
node data/js/echonest.js
data/out/songinfo-spotify-echonest-genres.json: data/out/songinfo-spotify-echonest.json
node data/js/musixmatch.js
data/out/songinfo-spotify-echonest-genres-whosampled.json: data/out/songinfo-spotify-echonest-genres.json
$(PYTHON) data/py/mergeWhoSampledGenres.py
data/out/songinfo-production.json: data/out/songinfo-spotify-echonest-genres-whosampled.json
$(PYTHON) data/py/trimForProduction.py
data: install data/out/songinfo-production.json
$(PYTHON) data/py/addManualGenres.py
data-whosampled:
# probably shouldn't use this - it's broken
# node data/js/whosampled.js
clean-js-search-cache:
rm data/cached/*
clean-shs-search-cache:
rm data/shs-search-cache/*
clean-shs-scrape-cache:
rm data/shs-scrape-cache/*
test-shs-api:
$(PYTHON) data/py/shsApiTests.py