Commits

Anonymous committed c5ba720

exclude log files from tarball. read role before setting any config

Comments (0)

Files changed (3)

     env.local_root = silk.lib.get_site_root(os.getcwd())
     env.config = silk.lib.get_site_config(env.local_root)
     env.silk_root='/srv'
+    if len(env.roles) == 0:
+        sys.exit("ERROR: you must define a role with -R <rolename>")
+    elif len(env.roles) > 1:
+        sys.exit("ERROR: Silk only permits passing in one role at a time")
+    else:
+        env.config.update(silk.lib.get_role_config(env.roles[0]))
     env.site = env.config['site']
     env.site_root = os.path.join(env.silk_root, env.site)
     env.rollback_cap = 5
     env.workdir = os.path.join('/tmp', env.site)
     env.rollbackdir = os.path.join(env.silk_root, 'rollbacks')
     env.deploytime = datetime.datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
-    if len(env.roles) == 0:
-        sys.exit("ERROR: you must define a role with -R <rolename>")
-    elif len(env.roles) > 1:
-        sys.exit("ERROR: Silk only permits passing in one role at a time")
-    else:
-        env.config.update(silk.lib.get_role_config(env.roles[0]))
     #set default socket to bind to
     if 'bind' not in env.config['gunicorn']:
         env.config['gunicorn']['bind'] = 'unix:/tmp/%s.sock' % env.config['site']
 
     #now archive env.srvdir if it exists
     if exists(env.srvdir):
-        sudo('tar -cjf %(rollbackdir)s/%(site)s-rollback_1.tar.bz2 -C %(silk_root)s %(site)s' % env)
+        sudo('tar -cjf %(rollbackdir)s/%(site)s-rollback_1.tar.bz2 --exclude "*.log" -C %(silk_root)s %(site)s' % env)
 
 def rollback():
     print "ROLLING BACK"

silk_deployment.egg-info/PKG-INFO

 Metadata-Version: 1.0
 Name: silk-deployment
-Version: 0.0.3
+Version: 0.0.5
 Summary: UNKNOWN
 Home-page: UNKNOWN
 Author: Brent Tubbs

silk_deployment.egg-info/SOURCES.txt

 MANIFEST.in
+setup.py
 silk/README
 silk/__init__.py
 silk/deps.yaml
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.