Since Drush is distributed as a PEAR package, it can be installed as project dependencies via Composer. This allow you to install Drush on a per-project basis, to ensure the proper version of is used. This is especially useful when using Drush in a build script run through a CI server such a Jenkins.
composer install Drush will be available in the
bin directory in your project dir. In order to use it from you shell, you need to add your the
bin direcotry to your path and set the
DRUSH_PHP environement variable. This can be done running the following commands from you project directory.
export DRUSH_PHP=`dirname $(which drush)`/composer-php;