-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (36 loc) · 2.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
RIAK_HOST=localhost
RIAK_PORT=8098
RIAK_HOME=http://$(RIAK_HOST):$(RIAK_PORT)
BUCKET_NAME=ngriakadmin
BUCKET_HOME=$(RIAK_HOME)/buckets/$(BUCKET_NAME)
BUCKET_HOME_OLD=$(RIAK_HOME)/riak/$(BUCKET_NAME)
check:
ifneq '$(shell curl -s http://localhost:8098/ping)' 'OK'
@echo Riak is not responding to ping on $(RIAK_HOME)/ping
@exit 1
else
@echo Riak is responding to pings. Good. Will install NgRiakAdmin on $(RIAK_HOST):$(RIAK_PORT)
endif
clean:
@curl -s -XDELETE $(BUCKET_HOME)/keys/index.html
@curl -s -XDELETE $(BUCKET_HOME)/keys/home.html
@curl -s -XDELETE $(BUCKET_HOME)/keys/riak.html
@curl -s -XDELETE $(BUCKET_HOME)/keys/settings.html
@curl -s -XDELETE $(BUCKET_HOME)/keys/buckets.html
@curl -s -XDELETE $(BUCKET_HOME)/keys/bucket.html
@curl -s -XDELETE $(BUCKET_HOME)/keys/key.html
@curl -s -XDELETE $(BUCKET_HOME)/keys/ngriakadmin.js
@curl -s -XDELETE $(BUCKET_HOME)/keys/settings.json
install: check
@curl -s -XPUT -H "Content-Type: text/html" --data-binary @src/index.html $(BUCKET_HOME)/keys/index.html
@curl -s -XPUT -H "Content-Type: text/html" --data-binary @src/home.html $(BUCKET_HOME)/keys/home.html
@curl -s -XPUT -H "Content-Type: text/html" --data-binary @src/riak.html $(BUCKET_HOME)/keys/riak.html
@curl -s -XPUT -H "Content-Type: text/html" --data-binary @src/settings.html $(BUCKET_HOME)/keys/settings.html
@curl -s -XPUT -H "Content-Type: text/html" --data-binary @src/buckets.html $(BUCKET_HOME)/keys/buckets.html
@curl -s -XPUT -H "Content-Type: text/html" --data-binary @src/bucket.html $(BUCKET_HOME)/keys/bucket.html
@curl -s -XPUT -H "Content-Type: text/html" --data-binary @src/key.html $(BUCKET_HOME)/keys/key.html
@curl -s -XPUT -H "Content-Type: text/javascript" --data-binary @src/ngriakadmin.js $(BUCKET_HOME)/keys/ngriakadmin.js
@curl -s -XPUT -H "Content-Type: application/json" --data-binary @src/settings.json $(BUCKET_HOME)/keys/settings.json
@echo NgRiakAdmin was installed. Open $(BUCKET_HOME_OLD)/index.html
insecure: install
@curl -XPUT -H "Content-Type: application/json" --data-binary @src/settings_insecure.json $(BUCKET_HOME)/keys/settings.json