forked from monarch-initiative/monarch-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MakefileRingo
145 lines (108 loc) · 4.43 KB
/
MakefileRingo
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
####
#### Development easing.
####
###
### Environment variables.
###
## Ringo
RINGO_MODULE_PATH ?= ../stick/lib:./modules:./node_modules:./lib/monarch
## TODO/BUG: highly non-canonical location--should be passed as
## variable, not hard-coded.
RINGO_BIN ?= ./tools/ringo
## Workaround for the above.
RINGO_CLI_BIN ?= /usr/bin/ringo
RINGO_PORT ?= 8080
## OWLTools.
#OWLTOOLS_MAX_MEMORY ?= 1G
OWLTOOLS_BIN ?= ~/local/src/svn/owltools/OWLTools-Runner/bin/owltools
## Version
MONARCH_VERSION = 0.1.1
###
### Tests
###
APITESTS = apitest literature-test class-info-test
TESTS = $(APITESTS) urltester
test: $(patsubst %, test-%, $(TESTS))
apitest: $(patsubst %, test-%, $(APITESTS))
production-test: $(patsubst %, production-test-%, $(TESTS))
test-%:
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_BIN) tests/$*.js
production-test-%:
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_BIN) tests/$*.js -s production
nif-production-url-test:
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_BIN) tests/urltester.js -s production -c vocabulary,ontoquest,federation,monarch
nif-production-federation-tests:
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_BIN) tests/urltester.js -s production -c federation
nif-production-scigraph-tests:
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_BIN) tests/urltester.js -s production -c scigraph
nif-production-federation-search-tests:
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_BIN) tests/urltester.js -s production -c federation-search
D2T_YAMLS = $(wildcard conf/rdf-mapping/*.yaml)
D2T_JSONS = $(D2T_YAMLS:.yaml=.json)
d2t: $(D2T_JSONS)
echo YAMLS: $^
triples: conf/monarch-context.jsonld d2t
# RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_BIN) bin/generate-triples-from-nif.js -c conf/server_config_production.json $(D2T_ARGS) conf/rdf-mapping/*-map.json && ./bin/target-ttl-to-owl.sh
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_BIN) bin/generate-triples-from-nif.js -c conf/server_config_dev.json $(D2T_ARGS) conf/rdf-mapping/*-map.json && ./bin/target-ttl-to-owl.sh
#SERVERCONF := production
SERVERCONF := dev
target/%.ttl: conf/rdf-mapping/%-map.json conf/monarch-context.jsonld
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_BIN) bin/generate-triples-from-nif.js -c conf/server_config_$(SERVERCONF).json $<
target/%.owl: target/%.ttl
owltools $< --set-ontology-id http://purl.obolibrary.org/obo/upheno/data/$*.owl -o -f ofn target/$*.owl
# TEMP
#conf/rdf-mapping/%.yaml: conf/rdf-mapping/%.json
# json2yaml.pl $< > [email protected] && mv [email protected] $@
YAML2JSON = yaml2json.pl
##YAML2JSON = python yaml2json.py
conf/rdf-mapping/%.json: conf/rdf-mapping/%.yaml
yaml2json.pl $< > [email protected] && mv [email protected] $@
conf/monarch-context.jsonld: conf/monarch-context.yaml
yaml2json.pl $< > [email protected] && mv [email protected] $@
###
### Compile the Solr schema and JSON config out of the YAML files.
###
solr-schema: ./conf/golr-views/*-config.yaml
$(OWLTOOLS_BIN) --solr-config $? --solr-schema-dump | ./scripts/remove-schema-cruft.pl > ./conf/schema.xml
.PHONY: golr-conf-as-json
golr-conf-as-json: ./conf/golr-conf.json
./conf/golr-conf.json: ./conf/golr-views
./scripts/confyaml2json.pl -i $< > [email protected] && mv [email protected] $@
reconfigure-golr: solr-schema golr-conf-as-json
###
### Documentation.
###
.PHONY: docs
docs:
naturaldocs --rebuild-output --input lib/monarch --project lib/.naturaldocs_project/ --output html docs/
###
### Create exportable JS bundle.
###
.PHONY: bundle
bundle:
./scripts/release-js.pl -v -i scripts/release-file-map.txt -o js/monarch.js -n monarch -d js -r $(MONARCH_VERSION)
###
### Deployment.
###
deploy: origin-push heroku-deploy
origin-push:
git push origin master
## cjm: http://secret-harbor-1370.herokuapp.com/
heroku-create:
heroku create --stack cedar --buildpack https://github.com/cmungall/heroku-buildpack-ringojs-jdk7.git --remote monarch-heroku
heroku-deploy:
git push monarch-heroku master
app-engine:
ringo-admin create --google-appengine gae
dependencies:
sh ./update_dependencies.sh
## Setup portable Ubuntu environment. -SJC
.PHONY: cli-launch-prod
cli-launch-prod: dependencies
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_CLI_BIN) ./lib/monarch/web/webapp_launcher_production.js --port=$(RINGO_PORT)
.PHONY: cli-launch-dev
cli-launch-dev: dependencies
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_CLI_BIN) ./lib/monarch/web/webapp_launcher_dev.js --port=$(RINGO_PORT)
.PHONY: cli-launch
cli-launch: dependencies
RINGO_MODULE_PATH=$(RINGO_MODULE_PATH) $(RINGO_CLI_BIN) ./lib/monarch/web/webapp_launcher.js --port=$(RINGO_PORT)