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

Useful basic linux stuff: Show kernel version, distribution name and distribution version on Ubuntu systems

Always nice to know: Show kernel version: uname -r Show kernel version and CPU: uname -a Show distribution version: lsb_release

phpstorm 7.0 php

How to setup and use XDEBUG with PHPStorm 6/7 (locally in Windows 7/8 and Mac OS X)

Real debugging is probably one of the most coolest things that are possible in software development: Remember the times where

goodbye-lamp-going-hhvm-nosql-nginx-php

[RePost] Goodbye LAMP: Going Nginx, NoSQL, HHVM (41min conference talk with Arne Blankerts)

Another excellent find by Germany’s PHP Magazin in the article “Nginx, NoSQL, HHVM: Goodbye LAMP Stack?“: 41 minutes super-interesting (english)

php

Must-read PHP blog: PHPweekly.com

Probably one of the best ressources for your weekly doze of news from the PHP scene: phpweekly.com simply publishes a

php

How to setup / install PHP 5.6 on Ubuntu 14.04 LTS

Ubuntu 14.04 LTS ships with PHP 5.5 by default, but if you want to use PHP 5.6, then it’s just

[Link] Making a website vertically responsive

Very useful tutorial by Ian Yates: How to make a website VERTICALLY responsive, adapting its content for small heights. Interesting

How to install/setup latest version of PHPMyAdmin on Ubuntu 12.04 LTS (Precise Pangolin)

As the official installation packages of most linux distributions are usually totally out of date (but that’s pure intention, to

angularjs

Two excellent introductions into AngularJS by Todd Motto

If you are familiar with PHP frameworks and have a basic understanding of what a model, a controller and a

php

PHP 5.6 announced, statically typed (!) “new” PHP announced by Facebook devs

PHP 5.6 goes alpha PHP 5.6 has been announced for a while now, and these days things get serious (code-freeze,

How to show memory usage (Ubuntu)

Always very useful: A simple command to show memory usage (Ubuntu / linux distros). cat /proc/meminfo  

1/4

Categories

Search

harper reed about big data
Harper Reed – The magic and mystery of Big Data (30min video from Webstock’15)
php
[Link] How to create, read, update and delete (CRUD) with PDO, MySQLi and MySQL the right way (prepared statements)
vagrant
A preinstalled Vagrant box with PHP HipHop / HHVM and Ubuntu 12.04 (Precise Pangolin)
sass laravel
Extremely easy SASS in Laravel (with pure PHP)
Symfony devs: Creator of Symfony framework is hiring (Cologne, Germany)!
php
appserver.io – A New Way of Magento Enterprise Infrastructure (26min video talk)
php
How to install/setup latest version of PHP 5.5 on Debian Wheezy 7.0/7.1/7.2 (and how to fix the GPG key error)
gamescom 2014 trailers
GAMESCOM 2014: Awesome Next-Gen ingame graphics
hiphop php
[Link] How to set up HipHop, Nginx and Laravel in Ubuntu 12.04 LTS (in a Vagrant box)
symfony-framework-logo
SensioLabs, creator of Symfony and Silex PHP frameworks, gets $7 million capital
css4
Angelina Fabbro talks about “CSS4” in this excellent conference video
php
How to install PHP 7.0 on Ubuntu 14.04 LTS
O’Reilly’s Programming JavaScript Applications by Eric Elliott for free (Early Access release)
php
How to install PHP curl extension (in 5 seconds)
sass laravel
SASSmeister is a real-time JSfiddle for SASS / CSS. Awesome!

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