Skip to content
blackout314 edited this page Dec 12, 2014 · 7 revisions

How to use

Setup

  • create id_rsa.pub for www-data
$ su www-data
$ ssh-keygen
  • secure your .ssh dir -> edit .htaccess
RewriteEngine on
RewriteRule .*\.ssh/.*$ - [R=404]
  • go bitbucket.org and insert id_rsa.pub in allowed keys

Clone

  • from shell
$ git clone https://github.com/GrayHats/bitbucket-deploy-php.git

Configure

  • edit deploy.php
$options = array(
  'log' => 'deployments.log',
  'date_format' => 'Y-m-d H:i:sP',
  'branch' => 'master',
  'remote' => 'origin',
);

Create Post Hook Actions

  • create posts hook
$deploy->post_deploy = function() use ($deploy) {
   exec('curl http://www.foobar.com/wp-admin/upgrade.php?step=upgrade_db');
   $deploy->log('Updating wordpress database... ');
};
Clone this wiki locally