Fabric is a Python (2.5 or higher)
library and command-line tool for
streamlining the use of SSH for
application deployment or systems
administration tasks.
Slide 11
Slide 11 text
͍
Slide 12
Slide 12 text
Fabric is a Python (2.5 or higher)
library and command-line tool for
streamlining the use of SSH for
application deployment or systems
administration tasks.
Slide 13
Slide 13 text
Fabric is a Python (2.5 or higher)
library and command-line tool for
streamlining the use of SSH for
application deployment or systems
administration tasks.
Slide 14
Slide 14 text
Application Deployment?
Slide 15
Slide 15 text
Πϯετʔϧ
ઃఆ
ىಈ
Slide 16
Slide 16 text
By SSH
Slide 17
Slide 17 text
ϗϫοτ
Slide 18
Slide 18 text
ϗϫοτ
Python
Slide 19
Slide 19 text
ϗϫοτ
Python
MySQL
Slide 20
Slide 20 text
ϗϫοτ
Python
MySQL
Nginx
Slide 21
Slide 21 text
ϗϫοτ
Python
MySQL
Nginx
gunicorn
Slide 22
Slide 22 text
ϗϫοτ
Python
MySQL
Nginx
gunicorn
Jenkins
Slide 23
Slide 23 text
ϗϫοτ
Python
MySQL
Nginx
gunicorn
Jenkins
mercurial
Slide 24
Slide 24 text
ϗϫοτ
Python
MySQL
Nginx
gunicorn
Jenkins
mercurial
Django
Slide 25
Slide 25 text
ϗϫοτ
Python
MySQL
Nginx
gunicorn
Jenkins
mercurial
Django
Nagios
Slide 26
Slide 26 text
ϗϫοτ
Python
MySQL
Nginx
gunicorn
Jenkins
mercurial
Django
Nagios
Slide 27
Slide 27 text
ϗϫοτ
Python
MySQL
Nginx
gunicorn
Jenkins
mercurial
Django
Nagios
memcached
Fabric is a Python (2.5 or higher)
library and command-line tool for
streamlining the use of SSH for
application deployment or systems
administration tasks.
Slide 74
Slide 74 text
Fabric is a Python (2.5 or higher)
library and command-line tool for
streamlining the use of SSH for
application deployment or systems
administration tasks.
# templates/my.cnf
:
# You can set .._buffer_pool_size up to 50 - 80 %
innodb_buffer_pool_size = {{ buffer_pool_size }}
:
Slide 132
Slide 132 text
append
Slide 133
Slide 133 text
from fabric.contrib.files import append
append(
filename='/etc/hosts',
text='10.0.0.101 dev-server',
)
Slide 134
Slide 134 text
uncomment
Slide 135
Slide 135 text
from fabric.contrib.files \
import uncomment
uncomment(
filename='/etc/vsftpd.conf',
regex='write_enable=YES',
char='#',
)
Slide 136
Slide 136 text
prefix
Slide 137
Slide 137 text
from fabric.api import run
from fabric.context_managers \
import cd
run('tar xzvf Python-2.7.3.tgz')
with cd('Python-2.7.3'):
run('./configure')
run('make')
sudo('make install')
Slide 138
Slide 138 text
from fabric.api import run
run('tar xzvf Python-2.7.3.tgz')
run('cd Python-2.7.3'):
run('./configure')
run('make')
sudo('make install')
from fabric.api import run
from fabric.context_managers \
import cd
run('tar xzvf Python-2.7.3.tgz')
with cd('Python-2.7.3'):
run('./configure')
run('make')
sudo('make install')
Slide 141
Slide 141 text
$ ssh (...) cd Python-2.7.3
$ ssh (...) cd Python-2.7.3 && ./configure
$ ssh (...) cd Python-2.7.3 && make
$ ssh (...) cd Python-2.7.3 && make install
Slide 142
Slide 142 text
from contextlib import contextmanager
from fabric.context_managers \
import prefix
@contextmanager
def workon(venv):
with prefix('workon ' + venv):
yield
Slide 143
Slide 143 text
with workon('myproj'):
run('pip install xaxtsuxo')
Slide 144
Slide 144 text
·ͱΊ
Slide 145
Slide 145 text
Deploy ͩΔ͍
Slide 146
Slide 146 text
Deploy ͩΔ͍
Shell Script ͏ඞཁͳ͠
Slide 147
Slide 147 text
Deploy ͩΔ͍
Shell Script ͏ඞཁͳ͠
ͦΕ Chef Ͱ | @tk0miya