Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Created fabric script for deploying

  • Loading branch information...
commit c96b5a4f98f41f0b5485aeb4da92eed6743947d5 1 parent f37ac3f
@alfredo alfredo authored
Showing with 37 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +3 −0  README.rst
  3. +30 −0 fabfile.py
  4. +3 −0  requirements.pip
View
1  .gitignore
@@ -1,2 +1,3 @@
.DS_Store
bin
+fabric.cfg
View
3  README.rst
@@ -0,0 +1,3 @@
+==========
+Sprite Cow
+==========
View
30 fabfile.py
@@ -0,0 +1,30 @@
+# Fabric for deploying the vodafone app
+import os
+import datetime
+import ConfigParser
+
+from fabric.colors import yellow
+from fabric.api import local, env
+
+PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
+here = lambda *x: os.path.join(PROJECT_ROOT, *x)
+
+config = ConfigParser.ConfigParser()
+config.readfp(open('fabric.cfg'))
+
+env.bucket = config.get('production', 'bucket')
+env.git_url = config.get('production', 'git_url')
+env.access_key = config.get('production', 'access_key')
+env.secret_key = config.get('production', 'secret_key')
+
+tmp_time = datetime.datetime.now()
+env.time = tmp_time.strftime("%Y%m%d_%H%M%S")
+env.clone_path = here('tmp', env.time )
+env.htdocs = here('tmp', env.time, 'www')
+
+def deploy():
+ """Deployment actions into S3 using s3put"""
+ local('mkdir -p %(clone_path)s' % env)
+ local('git clone %(git_url)s %(clone_path)s' % env)
+ local('s3put -a %(access_key)s -s %(secret_key)s -b %(bucket)s -p %(htdocs)s -g public-read %(htdocs)s' % env)
+ print yellow("Done?")
View
3  requirements.pip
@@ -0,0 +1,3 @@
+# Requirements are only used to deploy to Amazon S3
+Fabric==1.0.1
+boto==2.0rc1
Please sign in to comment.
Something went wrong with that request. Please try again.