Install drush in Gandi.net Simple Hosting

In this article I will explain how to install drush in a Simple Hosting instance of Gandi.net.

First we need to get SSH access and mv to the directory /srv/data/var/php/admin

The recommended method to install drush is using composer, but with Simple Hosting we cannot perform a global installation.

curl -sS https://getcomposer.org/installer | php
php composer.phar require drush/drush:7.*

Drush is now installed and can be used directly or in a script using the full path: /srv/data/var/php/admin/vendor/drush/drush/drush

Here is an example script that I use to upgrade my Drupal installations:

#!/bin/bash
 DRUSH="bash /srv/data/var/php/admin/vendor/drush/drush/drush"
 SITEPATH="/srv/data/web/vhosts/www.example.com"
 USERNAME=hosting-user
 GROUP=hosting-user
 cd $SITEPATH/htdocs/
 cp .htaccess ../
 $DRUSH pm-refresh && $DRUSH pm-update drupal --no-backup
 mv -f ../.htaccess ./
 cd ..
 chown -R $USERNAME.$GROUP $SITEPATH/htdocs/

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *