Automazione quotidiana in PHP
Il centro benessere del programmatore
http://phpday.it #phpday @k3aAutomazione
Qualità predicibile
Risparmio di tempo
Pace interiore
Deploy Backup Lavare la macchina Trasformare immagini Test del codice
Creazione documentazione Aggiornamento librerie Verifica
perfomance Alalisi dei log Lavare i denti Minimizzare JS e CSS Pulire cache
Inizializzare progetti Creare macchine virtuali Lanciare servizi Applicare patch ...
http://phpday.it #phpday @k3aGNU make
bmakebuildcake
Clearmakedistcc
distmakeDmakeJMakeJMK
kbuildmake
makeLibmakeme
MakeModulesMake:NGmakeplusmakepp
make utilitiesmk
mk-configuremmm
Mosmake
MPW MakenmakeOMake
Opus MakeParadigm
Visual Make
Prime MoverPrototype Makefiles
PVM Gmake
qmakeRakeSire
smakeSupermake
SMKtmkYabu
Apache AntApache Buildr
Apache IvyApache Maven
A-A-PBoost.Build
brasbuilditis
BuildtoolCabalCakecakecook
dev-envFlowtracer
GantGconfigure
Gradlehmake
Hyper BuildInvmakeIstrice
leiningenMeique
microbuildMSBuild
mxx-ruNAntninja
ocamlbuildOdinOSEpake
Perforce JamPerlBuildSystem
PhingProjectBuilder
pyntRant
SchmantSimple Build Tool
SConsShake
Source 2 BinarySweet Build
tupTweaker
Visual BuildWaf
XMakeXMAKEYruba
• immagine di GITHUB
phing
pake[la versione php non python]
idephix
Defining task [phing]<?xml version="1.0" encoding="UTF-8"?>
<project name="Foo" default="foo">
<target name="foo"
description="Description of foo task">
<echo msg="I am the ‘foo’ task" />
</target>
</project>
Run task [phing]$ phing -l
Buildfile: /Users/kea/build.xml
Default target:---------------------------------------------- foo Description of foo task
Subtargets:---------------------------------------------- foo Description of foo task
Run task [phing]$ phing foo
Buildfile: /Users/kea/build.xml
Foo > foo:
[echo] I am the ‘foo’ task
BUILD FINISHED
Total time: 0,0563 seconds
Defining task [pake]<?php
pake_desc('Description of foo task');
pake_task('foo');
function run_foo()
{
pake_echo('I am the "foo" task');
}
Run task [pake]$ pake -T
available pake tasks:
foo > Description of foo task
$ pake foo
I am the "foo" task
Defining task [idephix]<?php$idx = new Idephix();/** @Description Description of foo task */$idx->add('foo', function () {
echo "'I am the \"foo\" task'”;}$idx->run();
Defining task [idephix]<?php$idx = new Idephix();/** @Description Description of foo task */$idx->add('foo', function () use ($idx) {
$idx->output->writeln( "'I am the \"foo\" task'");
}$idx->run();
Run task [idephix]$ idx ___ _ _ _ |_ _|__| | ___ _ __ | |__ (_)_ __ | |/ _` |/ _ \ '_ \| '_ \| \ \/ / | | (_| | __/ |_) | | | | |> < |___\__,_|\___| .__/|_| |_|_/_/\_\ |_|Usage: [options] command [arguments]
Options: --help -h Display this help message.... --env Set remote environment.
Available commands: foo Description of foo task help Displays help for a command list Lists commands
Run task [idephix]
$ idx foo
I am the "foo" task
local - remote [idephix]$targets = array( 'test' => array( 'hosts' => array('server1.com', 'server2.com'), 'ssh_params' => array('user' => 'kea') ),);
$idx = new Idephix($targets);
$idx-> add('myTask:touchMe', function ($name, $go = false) use ($idx) { $idx->local('touch /tmp/'.$name); $idx->remote('touch /tmp/'.$name.'_remote'); });
Quali sono le differenze?
Pro
Phing
general purpose# task built-in
documentazionelarga diffusione
php in-task
Pake
general purpose# task built-inscrittura conf.file conf. PHP
Idephix
general purposemulti server
scrittura conf.file conf. PHP
Contro
Phing
grandi file conf. poco leggibili e
mantenibiliphp in-task
Pake
documentazionescarsamente
diffuso
Idephix
alphascarsamente
diffuso (per ora)
... altro?
PhpUnit
SSH
rsync
...
Perchè ho bisogno di un tool che “wrappa” X?
{X =
Ego slide
• Manuel “Kea” Baldassarri
• COO in
• Webdev dal 1992 e PHP dev dal 1998
• Coautore di “Pro PHP: best practices”
• Marito e bi-padre
• [email protected] twitter: k3a
• flickr: kea42 slideshare: kea42
Grazie!
?twitter: k3a slideshare: kea42
Copyright
• Tempi moderni [Charles Chaplin 1936]
• Harry Potter e il prigioniero di Azkaban [Warner Bros. Pictures 2004]
• In time [20th Century Fox 2011]
• Kung fu panda 2 [DreamWorks Animation 2011]
Top Related