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
php

How to install the mcrypt php extension (to use Laravel 4)

When installing Laravel 4 on a fresh Ubuntu or Debian system, you’ll probably get this error message: “Laravel requires the

java vs php

Switching from Java to PHP. Seriously. A very interesting and pre-judice-free talk with Ph.D. Aris Zakinthinos

Ph.D. Aris Zakinthinos, CTO of achievers.com, a well-scalability-experienced guy and former IT employee of the military, has just delivered one

PHPStorm: 42 Tips and Tricks (47min video talk by Mikhail Vink at Dutch PHP Conference 2015)

To be honest I’ve not seen the clip yet, but it sounds so awesome and everybody is upvoting it. Have

increase-your-pagespeed-score

Increase your PageSpeed score (10min video with Matt Gaunt)

Compact and clever information for dramatic speed increases. Definitly worth watching.

Migrating Wikipedia to HHVM (@Scale Conference 2014)

Awesome topic, superfresh, directly from Scale Conference 2014. The title says everthing. Full quote from video’s description: As a top

gamescom 2014 trailers

GAMESCOM 2014: Awesome Next-Gen ingame graphics

Currently Germany’s biggest conference of the gaming industry is running, and everyday awesome stuff reaches the public. Excellent in-game sequences

mod-rewrite-ubuntu-14-04-lts

How to install / setup PHP 5.5.x on Ubuntu 12.04 LTS

Please note: This works fine. But this package will also upgrade your apache to version 2.4 which has different config

How to fix the ugly font rendering in Google Chrome

Update, August 2014: Google has rolled out Chrome 37, which finally fixes this issue nativly. Yeah! For historical reasons the

hearthbleed-ssl-bug

A quick guideline on how to fix the Hearthbleed bug (and update OpenSSL) on Ubuntu

If you still haven’t fixed your servers after mainstream discovery of the legendary Hearthbleed bug, then do it now –

php

How to install PHP 7.0 on Ubuntu 14.04 LTS

You want to install PHP 7 within 60 seconds ? No problem, but first make sure you have a fresh

1/4

Categories

Search

hack-php
Wow! Facebook devs have rewritten and fixed PHP, releasing it as new language called “Hack” today
How to show the available version of a package (before doing apt-get install)
Useful basic linux stuff: Show kernel version, distribution name and distribution version on Ubuntu systems
harper reed about big data
Harper Reed – The magic and mystery of Big Data (30min video from Webstock’15)
[Link] Interesting: Designing a Nuclear Waste Warning Symbol That Will Still Make Sense in 10,000 Years
Hacked french TV channel exposed passwords in TV interview (video, screenshots, links)
forbes 30 under 30
Need motivation ? Check out these 2 awesome “FORBES 30 under 30” lists (web, UI, games)
js javascript
How JavaScript really works – An introduction into the JavaScript call stack by Philip Roberts (20min video)
ubuntu-14-04-lts lamp
How to install/setup a basic LAMP stack (Linux, Apache, MySQL, PHP) on Ubuntu 14.04 LTS
js javascript
JavaScript Testing Tactics (21min video by Justin Searls)
shadow dom
A quick video introduction into Shadow-DOM, the game-changing DOM-subtree-technology
composer
The difference between “composer install” and “composer update” – nailed on the head
Bézier Curves – Under the Hood (4min video)
[Link] Improving Smashing Magazine’s Performance: A Case Study
Perfect HTML email templates for perfect HTML emails (outlook!) with INK

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