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
#!/usr/bin/env python | |
import simplejson | |
import logging | |
import random | |
import re | |
import datetime | |
import string | |
import time | |
import sys | |
import urllib |
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 -*- | |
from celery.task import task | |
@task | |
def generate(model, pk, attr): | |
instance = model._default_manager.get(pk=pk) | |
file = getattr(instance, attr) | |
file.generate(save=True) | |
return attr |
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 fabric.api as api | |
with api.env_shell("PYTHONPATH=. DJANGO_SETTINGS_MODULE=settings.imagawa"): | |
api.run("python dosomething.py") |
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.context_managers import cd | |
from fabric.operations import sudo,run,local | |
from fabric.state import env | |
env.hosts = ['127.0.0.1',] | |
env.user = 'username' | |
env.deploy_user = 'django' | |
env.key_filename = ['/Users/soyrex/Keys/keyfile.pem',] | |
def stage(): | |
local('git push origin staging') |
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(): |
OlderNewer