Permalink
Browse files

added sample fabfile.

  • Loading branch information...
1 parent e9c8f54 commit 2b3078d11f3f350738dbe80e2dc9a9b8ff2ce146 Yamashita Yuu committed Aug 26, 2011
Showing with 57 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +43 −0 fabfile.py
  3. +7 −2 fabric_deploy/scm.py
  4. +6 −0 fabric_deploy/strategy.py
View
@@ -1,5 +1,6 @@
/*.egg-info
/*.orig
+/*.pyc
/*~
/.*.swo
/.*.swp
View
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+
+from fabric.api import *
+from fabric.decorators import *
+import logging
+
+from fabric_deploy.options import fetch
+
+@task(default=True)
+@runs_once
+def list_variables():
+## TODO: generate non-lazy keys automaticaly. see full keys from ./fabric_deploy/options.py.
+ immediate_keys = [
+ "application",
+ "branch",
+ "cached_path"
+ "current_path"
+ "deploy_to",
+ "deploy_via",
+ "git_enable_submodules",
+ "group_writable",
+ "latest_release"
+ "pybundle_path",
+ "release_name",
+ "release_path",
+ "releases_path",
+ "remote",
+ "repository",
+ "revision",
+ "runner",
+ "scm",
+ "service_name",
+ "shared_path",
+ "source",
+ "strategy",
+ "user",
+ "virtualenv",
+ ]
+
+ for key in immediate_keys:
+ print("{key} = {val}".format(key=key, val=fetch(key)))
+
+# vim:set ft=python :
View
@@ -47,10 +47,15 @@ def checkout(self, revision, destination, perform_fetch=True):
execute.append('{git} clean -d -x -f'.format(**kwargs))
return ' && '.join(execute)
+ def __str__(self):
+ return "git"
+
class Subversion(SCM):
- pass
+ def __str__(self):
+ return "subversion"
class Mercurial(SCM):
- pass
+ def __str__(self):
+ return "mercurial"
# vim:set ft=python :
@@ -34,6 +34,9 @@ def deploy(self):
revision=revision,
release_path=fetch('release_path')))
+ def __str__(self):
+ return "local_cache"
+
class RemoteCacheStrategy(Strategy):
def deploy(self):
cached_path = fetch('cached_path')
@@ -52,4 +55,7 @@ def deploy(self):
revision=revision,
release_path=fetch('release_path')))
+ def __str__(self):
+ return "remote_cache"
+
# vim:set ft=python :

0 comments on commit 2b3078d

Please sign in to comment.