forked from basho-labs/rekon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·44 lines (37 loc) · 919 Bytes
/
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
#!/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/riak/rekon"
echo "Installing rekon to $node..."
base_dir="`dirname $0`/app"
# 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/$f --data-binary @$base_dir/$f
done
echo "Installed, now visit: $riak_url/go"