This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import env, task | |
from fabric.decorators import runs_once | |
env.hosts = ['host1','host2','host3'] | |
@runs_once | |
def _pull(): | |
print "pull artifacts" | |
@task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import settings, roles, env, run, sudo, cd | |
from fabric.decorators import task | |
from fabric import tasks | |
from fabric.contrib.project import rsync_project | |
env.roledefs = { | |
'dev': [ | |
'vagrant@127.0.0.1:2222' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import * | |
import os | |
import fabric.contrib.project as project | |
# Local path configuration (can be absolute or relative to fabfile) | |
env.theme = 'themes/your-theme' | |
env.deploy_path = '/absolute/path/for/generated/output' | |
# Remote server configuration | |
prod = 'username@server.example.com:22' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabutils import needsDeployLocation, runAsAdmin | |
import os.path | |
@needsDeployLocation | |
@roles('www') | |
def deploy(): | |
""" | |
Deploys code to production servers | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
from fabric.api import * | |
from fabric.contrib.files import exists | |
env.use_ssh_config = True | |
env.hosts = ['locum'] | |
REPO = 'git@bitbucket.org:sapegin/grunt-talk.git' | |
DEST = 'projects/sapegin/htdocs/subprojects/pres/grunt' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from os import path | |
from fabric.api import local, settings, abort, run, cd, env, sudo | |
from fabric.contrib.project import rsync_project | |
env.hosts = [host,] | |
env.user = 'user' | |
exclude = [] | |
def prepare_deploy(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _shard_array(inlist, shard_size): | |
# inlist = 150-element list | |
# shard_size = 40 | |
num_shards = len(inlist) / shard_size | |
# num_shards == 3 | |
shards = [] | |
for i in range(num_shards): | |
# i == 0 | |
start = shard_size * i # start == 0, then 40, then 80... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
import time | |
import settings | |
from fabric.contrib.console import confirm | |
from fabric.api import local, settings as fabric_settings, env, cd, run, sudo | |
env.hosts = ['domain_or_ip'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select address from mailer_email into outfile '/home/gileno/emails3.txt'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
from django.db import models | |
from django.utils.translation import ugettext_lazy as _ | |
from django.contrib.auth.models import User | |
from django.core.files.storage import FileSystemStorage | |
from django.conf import settings |