Created
November 19, 2013 07:51
-
-
Save nikuuchi/7541788 to your computer and use it in GitHub Desktop.
簡単なfabricのutil
This file contains hidden or 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 local, env, run, sudo, cd | |
| from fabric.decorators import task | |
| import time | |
| from datetime import date | |
| env.use_ssh_config = True | |
| env.user = 'FIXME' | |
| env.password = 'FIXME' | |
| @task | |
| def app(): | |
| env.hosts = ['host1'] | |
| @task | |
| def web(): | |
| env.hosts = ['host2'] | |
| @task | |
| def test(): | |
| run('echo hoge') | |
| @task | |
| def pull(): | |
| with cd('~/app'): | |
| run('git fetch origin') | |
| run('git merge origin/master') | |
| @task | |
| def zip(): | |
| with cd('~'): | |
| today = date.today() | |
| sudo('zip '+ today.isoformat()+ '.zip /tmp/*.c /tmp/*.js') | |
| @task | |
| def install_zip(): | |
| sudo('apt-get install zip -y') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment