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
js javascript

[video] Netflix JavaScript Talks about ECMAScript 7: The Evolution of JavaScript

mod-rewrite-ubuntu-14-04-lts

Which server OS version to choose ? Some EOL lists of Debian, Ubuntu and CentOS

Moving running projects (especially smaller ones that you’ve made for clients years ago) from an outdated and not-supported linux version

atomic-design

An introduction into Atomic Design, a super-clean way to style web applications

A super-interesting talk of Brad Frost at beyond tellerrand 2013, explaining the basics of Atomic Design: What is Atomic Design

php

12 tools for better PHP quality

Nice selection of 12 tools every PHP developer should bookmark. I totally love how the PHP community becomes some kind

php

Test out PHP 5.6alpha1 on Windows 7 / 8 with two clicks

The popular Apache-MySQLP-PHP stack EasyPHP has become very professional, maintained and especially modularized in the last 2 years, and when

Serious hard-to-fix bug in OAuth and OpenID discovered, lots of major sites affected

Just a short notice rather than a real article, full story later (I need to check the facts): Several sources

vagrant

A preinstalled Vagrant box with PHP HipHop / HHVM and Ubuntu 13.10 (Saucy Salamander)

Here’s an excellent downloadable Vagrant box that’s brings you a preinstalled HHVM / HipHop for PHP within a Ubuntu 13.10

java

Interesting: code of the same application in PHP, Python, Ruby, Closure, node.js, Java and Go

Definitly worth a look: Adam Bard created a tiny application in 4 different languages (PHP, Python, Ruby, Closure), just to

anti block adblock

Show ads to ad-blockering visitors – with PageFair.com

Interesting news on the dramatically decreasing web ad market: There’s a new service called PageFair that does basically exactly what

O’Reilly’s Learning JavaScript Design Patterns by Addy Osmani for free

Addy Osmani has published his excellent book Learning JavaScript Design Patterns for free! You can read the entire book including

1/4

Categories

Search

goodbye-lamp-going-hhvm-nosql-nginx-php
[RePost] Goodbye LAMP: Going Nginx, NoSQL, HHVM (41min conference talk with Arne Blankerts)
gamescom 2014 trailers
GAMESCOM 2014: Awesome Next-Gen ingame graphics
-45% (or even 50%) off on DesignWall today
DEF CON 18 – When your computer got stolen and you can still SSH into it: “Pwned by the 0wner” (22min conference talk)
How to setup a config-free WordPress, PHP and MySQL (for local development) in Windows 7 / 8 in under 3 minutes
hearthbleed-ssl-bug
A quick guideline on how to fix the Hearthbleed bug (and update OpenSSL) on Ubuntu
Migrating Wikipedia to HHVM (@Scale Conference 2014)
css3-chrome-font
Google rolls out Chrome 37, finally fixes horrible font-rendering
hiphop php
[Link] How to set up HipHop, Nginx and Laravel in Ubuntu 12.04 LTS (in a Vagrant box)
php
PHP 5.6 announced, statically typed (!) “new” PHP announced by Facebook devs
vagrant
A preinstalled Vagrant box with PHP HipHop / HHVM and Ubuntu 12.04 (Precise Pangolin)
photoshop-cc-deal
Adobe offers Photoshop for $9.99 per month (limited deal)
php
How to install latest PHP 5.4.x on Ubuntu 12.04 LTS (Precise Pangolin)
php
Awesome list of Design Patterns with PHP code examples
php
Postmodern PHP: appserver.io, a multithreaded application server for PHP, written in PHP

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