Upgrade to Pro — share decks privately, control downloads, hide ads and more …

introduction the fabric tools

introduction the fabric tools

Ching Yi Chan

October 14, 2012
Tweet

More Decks by Ching Yi Chan

Other Decks in Programming

Transcript

  1. Server Admin ၍ server ேίِԬʡჿ deploy the java web application

    maintain various settings on the server be a watchdog for many purposes
  2. fabric http:/ /docs.fabfile.org 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.
  3. using fabric as cmd fab ${OPTS} -- ${COMMANDS} fab -H

    s1,s2 -- uptime fab -P -H s1,s2 -- uptime fab -w -P -H s1,s2 -- uptime
  4. using fabric api ϞࡳԬ function ̙˸͜lk ޶ code ˢ޶˖΁һٜᙂ :D

    fabric/api.py https:/ /github.com/fabric/fabric/blob/master/ fabric/api.py
  5. do something who where which context thinking in fabric sequence

    parallel how to execute local script remote script
  6. do something who where which context thinking in fabric sequence

    parallel how to execute local script remote script ༈ਂٙԫఱνΝࡡ͉ᄳ TIFMM TDSJQU ԟছf ҷ͜ GBCSJD BQJ ᄳdɰ஢̥݊εəɓᓃ QZUIPO ϾϞፋʲช ఊॱ൙ሞ̴d̥ SFNPUF TDSJQU ೹މکлᇦəf from fabric.api import run, task @task def uptime(): run("uptime")
  7. do something who where which context thinking in fabric sequence

    parallel how to execute local script remote script from fabric.api import run, task, env env.user = ‘qrtt1’ env.hosts = [‘server1’, ‘server2’] @task def uptime(): run("uptime") л͜ DPOUFYU ฿ׂd ਗ਼œܸ˿ٙœੂБ٫eœੂБЗໄפᕎd ̘દəœᕏׂٙ UBTL һ࢙׸஗ SFVTFd һϞዚึϓމ΂จଡ଼Υٙœᆀ৷ጐ˝
  8. do something who where which context thinking in fabric sequence

    parallel how to execute local script remote script from fabric.api import run, task, env, roles, parallel env.user = ‘deployer’ env.roledefs = {'web':['s1', 's2', 's3'], 'db':['s4']} @task @roles(‘web’, ‘db’) @parallel def uptime(): run("uptime")