forked from ls1248659692/python_guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfabric_script.py
More file actions
54 lines (36 loc) · 1.28 KB
/
fabric_script.py
File metadata and controls
54 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/python
# coding=utf8
from __future__ import with_statement
from fabric.context_managers import lcd
from fabric.operations import local
__author__ = 'Jam'
__date__ = '2019/5/29 15:09'
def update():
local("sudo apt-get update")
def git():
local("sudo apt-get install git")
local("git config --global user.name 'Pasquali'")
local("git config --global user.email 'pasaquali@gmail.com'")
def python():
local("sudo apt-get install python")
def setup_tools():
local("sudo apt-get install python-setuptools")
def pip():
local("sudo apt-get install python-pip python-dev build-essential -y")
def create_virtual():
local("sudo pip install virtualenv virtualenvwrapper")
bashrc_dir = '..'
with lcd(bashrc_dir):
local("echo 'export WORKON_HOME=~/.virtualenvs' >> .bashrc")
local("echo '. /usr/local/bin/virtualenvwrapper.sh' >> .bashrc")
def edit_vimrc():
vimrc_file = '..'
with lcd(vimrc_file):
local("git clone https://github.com/amix/vimrc.git ~/.vim_runtime")
local("sh ~/.vim_runtime/install_awesome_vimrc.sh")
def messages():
local("echo '. ~/.bashrc'")
local("")
local("echo do not forget to begin a virtualenv before starting part 2")
local("")
local("echo do not forget to edit vim.rc")