forked from basho-labs/rekon
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brian Rowe
authored and
Brian Rowe
committed
Nov 14, 2011
1 parent
7073ffa
commit da9d179
Showing
11 changed files
with
227 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<tr> | ||
<td colspan="7"><%= value %></td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Alice was beginning to get very tired of sitting by her sister on the | ||
bank, and of having nothing to do: once or twice she had peeped into the | ||
book her sister was reading, but it had no pictures or conversations in | ||
it, 'and what is the use of a book,' thought Alice 'without pictures or | ||
conversation?' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
So she was considering in her own mind (as well as she could, for the | ||
hot day made her feel very sleepy and stupid), whether the pleasure | ||
of making a daisy-chain would be worth the trouble of getting up and | ||
picking the daisies, when suddenly a White Rabbit with pink eyes ran | ||
close by her. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The rabbit-hole went straight on like a tunnel for some way, and then | ||
dipped suddenly down, so suddenly that Alice had not a moment to think | ||
about stopping herself before she found herself falling down a very deep | ||
well. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,108 @@ | ||
#!/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" | ||
;; | ||
#!/bin/bash | ||
# Author: Brian Lee Yung Rowe | ||
# Date: 2001.07.14 | ||
# Rewritten from the original version by Adam Hunter | ||
|
||
do_exit() | ||
{ | ||
echo $1 | ||
exit $2 | ||
} | ||
|
||
do_usage() | ||
{ | ||
do_exit "Usage: $0 [aejd] [host:port]" $1 | ||
} | ||
|
||
content_type() | ||
{ | ||
case $1 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";; | ||
*) content_type="text/plain";; | ||
esac | ||
echo $content_type | ||
} | ||
|
||
#echo "Uploading $f" | ||
curl -X PUT -H"Content-Type: $content_type" $riak_url/$f --data-binary @$base_dir/$f | ||
done | ||
do_install_rekon() | ||
{ | ||
echo "Installing rekon to $node..." | ||
riak_url="http://$node/riak/rekon" | ||
base_dir="`dirname $0`/app" | ||
|
||
for f in $(ls $base_dir); do | ||
[ -n "$verbose" ] && echo "Uploading $f to rekon" | ||
content_type=$(content_type $f) | ||
curl -X PUT -H"Content-Type: $content_type" $riak_url/$f --data-binary @$base_dir/$f | ||
done | ||
} | ||
|
||
do_install_jobs() | ||
{ | ||
echo "Installing jobs" | ||
riak_url="http://$node/riak/rekon.jobs" | ||
base_dir="`dirname $0`/jobs" | ||
for f in $(ls $base_dir) | ||
do | ||
[ -n "$verbose" ] && echo "Uploading job $f to rekon.jobs" | ||
content_type="application/javascript" | ||
curl -X PUT -H"Content-Type: $content_type" $riak_url/$f --data-binary @$base_dir/$f | ||
done | ||
} | ||
|
||
do_install_data() | ||
{ | ||
echo "Installing data" | ||
riak_url="http://$node/riak" | ||
base_dir=$(dirname $0)/buckets | ||
for bucket in $(ls $base_dir) | ||
do | ||
dir=$base_dir/$bucket | ||
[ -n "$verbose" ] && echo "Adding bucket $bucket" | ||
for f in $(ls $dir) | ||
do | ||
[ -n "$verbose" ] && echo "Adding file as $bucket/$f" | ||
content_type=$(content_type $f) | ||
curl -X PUT -H"Content-Type: $content_type" $riak_url/$bucket/$f --data-binary @$dir/$f | ||
done | ||
done | ||
} | ||
|
||
riak_url="http://$node/riak/rekon.jobs" | ||
base_dir="`dirname $0`/jobs" | ||
for f in $(ls $base_dir) | ||
do_install_erlang() | ||
{ | ||
echo "Installing erlang modules to $module_dir" | ||
sudo mkdir -p $module_dir | ||
sudo erlc -o $module_dir erlang/*.erl | ||
|
||
} | ||
|
||
node="127.0.0.1:8098" | ||
module_dir=/etc/riak/erlang | ||
while getopts "aeE:jdv?" option | ||
do | ||
content_type="application/javascript" | ||
#echo "Uploading $f" | ||
curl -X PUT -H"Content-Type: $content_type" $riak_url/$f --data-binary @$base_dir/$f | ||
case $option in | ||
a) erlang=yes; jobs=yes; data=yes;; | ||
e) erlang=yes;; | ||
E) erlang=yes; module_dir=$OPTARG;; | ||
j) jobs=yes;; | ||
d) data=yes;; | ||
v) verbose=yes;; | ||
'?') usage 0;; | ||
*) usage 1;; | ||
esac | ||
done | ||
shift $(($OPTIND - 1)) | ||
|
||
[ -n "$1" ] && node=$1 | ||
|
||
do_install_rekon | ||
[ -n "$jobs" ] && do_install_jobs | ||
[ -n "$data" ] && do_install_data | ||
[ -n "$erlang" ] && do_install_erlang | ||
|
||
module_dir=/etc/riak/erlang | ||
sudo mkdir -p $module_dir | ||
sudo erlc -o $module_dir erlang/*.erl | ||
|
||
echo "Installed, now visit: $riak_url/go" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{"language":"javascript","source":" | ||
function(v) { | ||
var m = v.values[0].data.toLowerCase().split(' '); | ||
var r = []; | ||
for(var i in m) { | ||
if(m[i] != '') { | ||
var o = {}; | ||
o[m[i]] = 1; | ||
r.push(o); | ||
} | ||
} | ||
return r; | ||
} | ||
"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{"language":"javascript", "source":" | ||
function(v,k,a) { | ||
print(v); | ||
return [ x ]; | ||
} | ||
"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{"language":"javascript","source":" | ||
function(v) { | ||
var r = {}; | ||
for(var i in v) { | ||
for(var w in v[i]) { | ||
if(w in r) r[w] += v[i][w]; | ||
else r[w] = v[i][w]; | ||
} | ||
} | ||
return [r]; | ||
} | ||
"} |