Logo
  • PHP
    • HipHop / HHVM
    • Modern PHP
    • PHPStorm
    • LAMP
    • Laravel
    • Composer
    • PDO
  • JavaScript
    • node.js
    • AngularJS
  • CSS
    • SASS
    • “CSS4” (CSS level 4)
  • HTML
  • Git
  • LAMP
  • Vagrant
  • UI / UX
  • Architecture of …
  • Off-Topic
With ♥ from Berlin
March 1, 2014
Chris
Deployment, PHP
Comments Off on Extremely simple deployment with PHPloy

Extremely simple deployment with PHPloy

PreviousNext
git-php-deployment

Let me ask you a question: How mad do you get when you have to remember which files you edited and select them on FileZilla to upload to the server? That’s right – very mad. And sometimes you just upload the whole project because you don’t remember what you edited. I have four words for that: “Been there; done that”. Out of that frustration I set out to find a script that would use Git to determine which files I had edited, since this is what Git does best, and upload those to the server through FTP.

I think everbody can agree to this statement of Baki Goxhaj on his blog WPlancer. Deployment, the process of moving your (updated) code to the live server(s), is something everybody has to deal with, but only very advanced people do it in a professional way. I’ve seen web agencies with 100+ employees, most of them developers, releasing stuff with pure drag & drop FTP. Ouch! Unless you are ready to work with professional tools like Jenkins or Capistrano try this tiny tool that totally does the job:

PHPloy is just a simple PHP file run on the bash (plus a config .ini) that copies all changes from the last deployed commit to the defined server. One command on the command line. Rollbacks are also possible, with one line of code. The configuration of a server is… well, one line of code. Super-simple, super-effective. I love stuff like that!

 

A basic workflow (advanced ways are possible too)

Put PHPloy (bash file with pure PHP content and .ini) into your project’s root.

Edit the .ini and put your FTP credentials in there and name your server(s). It’s possible to use lots of servers.

[quickmode]
    staging = ftp://example:password@staging-example.com:21/path/to/installation 
    production = ftp://example:password@production-example.com:21/path/to/installation

Run a deployment via

phploy

to deploy to all servers defined in the .ini (normally just one) or use this line to deploy to a certain one:

phploy --server servername

Done. Please make sure you never put the .ini file into a public place accidently as it holds your FTP credentials.

For rollbacks use

phploy --rollback

to get back to the last deployed version.

 

PHPloy on GitHub

PHPloy tutorial on Baki’s blog

 

deploydeploymentPHPphploy
Share this
hiphop php

[Link] How to set up HipHop, Nginx and Laravel in Ubuntu 12.04 LTS (in a Vagrant box)

This is probably the most useful tutorial in 2014 so far. An excellent post by Chris Fidao, explaining how to

Awesome next-gen PS4 graphics in “The Order: 1886”

We are entering a very interesting time: The differences between cinematic movies and video games are getting lesser and lesser.

JavaScript ECMAScript6 – A short video introduction (5min)

Excellent introduction into the new ECMAScript6, the spec behind JavaScript.

mod-rewrite-ubuntu-14-04-lts

EOL lists of Ubuntu, Debian and CentOS for your server plannings

Chosing the right server operating system will probably save your life and avoid a lot of stress with your clients.

The New Era of JavaScript (28min conference talk, Jack Franklin, 2013)

Frontend Ops Conf 2014 – Paul Irish: Delivering The Goods In Under 1000ms (40min video)

https://www.youtube.com/watch?v=E5lZ12Z889k

(Links) How to fix an extremely slow Symfony inside a Vagrant box

When you work with Vagrant (if not – try it!) on a Windows or Mac machine (which is an excellent

composer

The difference between “composer install” and “composer update” – nailed on the head

What a beautiful, direct and clean explaination of the often-confusing difference between composer install and composer update: Beau Simensen (Twitter,

php

[Link] How to create, read, update and delete (CRUD) with PDO, MySQLi and MySQL the right way (prepared statements)

Mike Dalisay has written an excellent tutorial on the CORRECT USAGE of basic CRUD functions (create, read, update, delete) with

twig

A 6min video introduction into Twig, the PHP templating engine

Cool video, excellently explained. Just 6 minutes, but features all the basics. Note that you can integrate Twig into your

1/4

Categories

Search

js javascript
[video] Netflix JavaScript Talks about ECMAScript 7: The Evolution of JavaScript
phpstorm 7.0 php
PHPStorm 7 has been released!
The New Era of JavaScript (28min conference talk, Jack Franklin, 2013)
vagrant
A preinstalled Vagrant box with PHP HipHop / HHVM and Ubuntu 13.10 (Saucy Salamander)
phpstorm 7.0 php
How to setup and use XDEBUG with PHPStorm 6/7 (locally in Windows 7/8 and Mac OS X)
mod-rewrite-ubuntu-14-04-lts
How to enable mod_rewrite in Ubuntu 12.04 LTS
[Link] Improving Smashing Magazine’s Performance: A Case Study
mod-rewrite-ubuntu-14-04-lts
How to enable mod_rewrite in Ubuntu 14.04 LTS
php
A super-simple introduction into PHP namespaces (7min video)
php-legacy-code
Interesting talk on modernizing a legacy PHP codebase
photoshop-cc-deal
Adobe offers Photoshop for $9.99 per month (limited deal)
java vs php
Switching from Java to PHP. Seriously. A very interesting and pre-judice-free talk with Ph.D. Aris Zakinthinos
php
Somebody is writing a compiler for PHP, compiles down to machine code, outperforms HHVM
DEF CON 18 – When your computer got stolen and you can still SSH into it: “Pwned by the 0wner” (22min conference talk)
php
appserver.io – A New Way of Magento Enterprise Infrastructure (26min video talk)

Tags

apache bash centos composer conference coupon CSS debian fonts framework git GitHub hack HHVM HipHop HTML HTML5 IDE JavaScript JS LAMP laravel linux mod_rewrite MVC MySQL Nginx optimization PHP PHP 5.5 PHP 5.6 phpmyadmin PHPStorm security server SSD Ubuntu UI UX vagrant video virtual machine voucher VPS wordpress
Side-Project: Wordle-Solver:
www.wordle-helper.info

Pages

  • Privacy Policy