summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-01-27 13:08:44 -0500
committerEliot Horowitz <eliot@10gen.com>2009-01-27 13:08:44 -0500
commitdf7c7536404ea531b8253541fedb4f51098d7bb1 (patch)
tree67881cf3ff1ba70d03d628365f1c1c43a4307cd8
parent502a5e6e86d22e381526d910e4744375a788a573 (diff)
downloadmongo-df7c7536404ea531b8253541fedb4f51098d7bb1.tar.gz
s3shell target for pushign shell to s3
-rw-r--r--.gitignore2
-rw-r--r--SConstruct28
2 files changed, 30 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 71605aeb71a..806b8556c73 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,12 +15,14 @@
*.pch
*.jsh
*.jsall
+*.pyc
db/Debug
db/oplog*
db/.gdb*
db/makefile.local
config.log
+settings.py
#temp dirs
dump
diff --git a/SConstruct b/SConstruct
index fb42a2266ee..0138b54cd7e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -5,6 +5,7 @@
# then just type scons
import os
+import sys
# --- options ----
AddOption('--prefix',
@@ -412,3 +413,30 @@ def gitPush( env, target, source ):
return subprocess.call( [ "git", "push" ] )
env.Alias( "push", [ ".", "smoke", "checkSource" ], gitPush )
env.AlwaysBuild( "push" )
+
+
+# ---- deploying ---
+
+def s3push( localName , remoteName=None , remotePrefix="-latest" ):
+ sys.path.append( "." )
+
+ import simples3
+ import settings
+
+ s = simples3.S3Bucket( "mongodb" , settings.id , settings.key )
+ un = os.uname()
+
+ if remoteName is None:
+ remoteName = localName
+
+ name = remoteName + "-" + un[0] + "-" + un[4] + remotePrefix
+ name = name.lower()
+
+ s.put( name , open( localName ).read() , acl="public-read" );
+ print( "uploaded " + localName + " to http://s3.amazonaws.com/" + s.name + "/" + name )
+
+def s3shellpush( env , target , source ):
+ s3push( "mongo" , "mongo-shell" )
+
+env.Alias( "s3shell" , [ "mongo" ] , [ s3shellpush ] )
+env.AlwaysBuild( "s3shell" )