Skip to content

Fabric based deployment

Volkan Florchinger edited this page Jan 19, 2015 · 7 revisions

Please check the fabalicious docs for more in depth information. To give a really short summary: fabalicous is fabric based wrapper for drush.

Simple command example

fab config:live deploy

Which will log into your 'live' instance create a DB backup, run a git pull, drush updb, feature revert and cache clear. All the things you wanna do when deploying new stuff.

More advanced usage but just one of many features

fab config:local copyFrom:live

Which would copy files and DB from the live system to your local dev environment. Wanna know more about that check out basebox for local development. The project will create a local development environment (a docker instance in a vagrant box).

Install

  1. You need to install python

    brew install python  
    pip install fabric  
    pip install pyyaml  
    
  2. We recommend adding fabalicious as a submodule to your project. Downloading the zip file would work of course work too. The fabalicious folder shouldn't be accesible since the yaml configuration may contain sensitive information.

    git submodule add https://github.com/stmh/fabalicious.git
    
  3. Create an fabfile.yaml

     name: YOURPROJECT
     deploymentModule: YOURPROJECT_deploy # http://dcycleproject.org/blog/44/what-site-deployment-module
    
     useShell: false
     usePty: false
    
     common:
      deployment:
        # custom commands to add on deployment
        - "drush vset devel_rebuild_theme_registry FALSE"
     live:
       host: o1234567890.v11.lon.host1.biz
       port: 22
       user: o1234567890.ftp
       branch: master
       rootFolder: /data/disk/o1234567890/static/YOURPROJECT/public
       tmpFolder: /home/o1234567890.ftp/tmp/
       siteFolder: /sites/YOURPROJECT.com
       gitRootFolder: /data/disk/o1234567890/static/YOURPROJECT
       filesFolder: /sites/YOURPROJECT.com/files
       backupFolder: /home/01234567890.ftp/backup
       hasDrush: true
       useForDevelopment: false
       ignoreSubmodules: true
       supportsBackups: true
       supportsCopyFrom: true
       supportsZippedBackups: False
       supportsInstalls: false
       useShell: False
       usePty: False
    

We use this in production for more than a year now but not all features are very well documented. If you need support please bug us in the issue queues on github :)