Commit 90d104d9 authored by nimrod's avatar nimrod
Browse files

Use Fabric's module instead of rsync manually.

parent c256af18
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -6,6 +6,5 @@ My Debian repository, minus the state (packages, db, etc.).
todo
----

- Use Fabric's module instead of rsync manually.
- License.
- Add GPG key.
+11 −4
Original line number Diff line number Diff line
#!/usr/bin/env python
from fabric.api import task, local
from fabric.api import task, local, env, hosts
from fabric.contrib.project import rsync_project
from os import environ

env.use_ssh_config = True


@task
@hosts('www.shore.co.il')
def publish():
    local('''rsync -az --del --exclude="conf/" --exclude="db/" \
    --exclude="fabfile.*" --exclude="lists/" $REPREPRO_BASE_DIR\
    www.shore.co.il:/var/www/htdocs/www.shore.co.il/repo/''')
    rsync_project(remote_dir='''/var/www/htdocs/www.shore.co.il/repo''',
                  exclude=['''fabfile.*''', 'lists/', 'conf/', 'db/'],
                  local_dir=environ['REPREPRO_BASE_DIR'],
                  delete=True,
                  extra_ops='-z')


@task