Rocketeer is a command line
PHP deployment tool. I have used Capistrano
for deployment in the past, and really enjoyed using it. Rocketeer is
similar to Capistrano. It's extremely easy to set-up, and is a
breeze to work with.
PHP-mcrypt module is required on the server you are deploying to.
Centos Install Instructions
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm yum update yum install php-mcrypt*
The below example uses 2 servers. A web server hosting your site and a server
that is running the commands to deploy your code. This is usually your build
Bamboo are two commonnly used build servers.
This is the
Apache virtual host used in the example below.
<VirtualHost *:80> DocumentRoot /var/www/example/current </VirtualHost>
Create a build directory (Deployment server)
mkdir ~/example_deployment cd ~/example_deployment
Download Composer (Web server)
curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer
Download Rocketeer (Deployment server)
wget http://rocketeer.autopergamene.eu/versions/rocketeer.phar mv rocketeer.phar /usr/local/bin/rocketeer chmod +x /usr/local/bin/rocketeer
Initialize deployment folder (Deployment server)
Configure .rocketeer/config.php (Deployment server)
- Set the application_name. In my case, I have set the application name as example. This will be the name of the folder your application gets deployed to on the web server. (If you want the application deployed in a different directory, you can change the app_directory value in remote.php)
- Configure the connections array. (Production, Staging, QA, etc)
Configure .rocketeer/remote.php (Deployment server)
- Set the
root_directoryvariable. This is the parent path of your application (Example:
- Under the permissions section, change
Configure .rocketeer/scm.php (Deployment server)
- Set scm variable to svn (SVN is used in this example, but you can use git).
- Set your repository path. Example:
https://github.com/tullyrankin/example(add .git to the end of the URL when using git)
- If we are doing SVN as the scm, the branch value needs to be empty.
- If we are doing SVN the submodules value should be set to false.
Set-up the folder structure needed for the application (Deployment server)
Run a check to make sure everything is working
If no errors were reported, you can now deploy the application
After a few releases you may run into a bad release and need to rollback. In this case use the following command. (Deployment server)