-
Notifications
You must be signed in to change notification settings - Fork 26
/
install.sh
executable file
·47 lines (39 loc) · 1.05 KB
/
install.sh
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
#!/bin/sh
# Allow running the script and specifiying an install target
# ./install node-address:host
if [ -n "$1" ] ; then
node=$1
else
node="127.0.0.1:8098"
fi
riak_url="http://$node/buckets/rekon"
echo "Installing rekon to $node..."
base_dir="`dirname $0`/app"
# set allow_mult = false for rekon's bucket
curl -X PUT -H "Content-Type: application/json" -d '{"props":{"allow_mult":false}}' $riak_url/props
# loop through everything in the app directory and put in in the rekon bucket
for f in $(ls $base_dir); do
# echo "Uploading $f to riak"
case $f in
go | *.html )
content_type="text/html"
;;
*.js )
content_type="application/javascript"
;;
*.css )
content_type="text/css"
;;
*.png )
content_type="image/png"
;;
*.gif )
content_type="image/gif"
;;
*.template )
content_type="application/x-sammy-template"
;;
esac
curl -X PUT -H "Content-Type: $content_type" $riak_url/keys/$f --data-binary @$base_dir/$f
done
echo "Installed, now visit: $riak_url/keys/go"