Presentation for Codeworks 2012 Atlanta. This presentation went through what Phing is, how to set it up, example, and how we implemented it with our applications.
Tasks
• Single piece of executable
code
• Core:
– Copy, Delete, Echo, Exec, Mo
ve, Foreach, and more
• Optional:
– FtpDeploy, GitPush, PDOSQL
Exec, Scp, Zip, and more
Property File
• Text file Example:
• Good way to
organize variables
into one location
• Useful for
environment specific
files
Types
• Used within a task Example:
• More complex data
variables
– FileSet
• PatternSet
• * vs. **
– Excludes
Filters and Mappers
• Filters Transform data/file contents within a task
– Tidy
– ExpandProperty
– StripPhpComments
• Mappers are like filters for files and directories
– Flatten
– Glob
– RegExp
Conditions
• Used through the following
two tasks: Example:
– condition
– if
• Compare using
– equals
– isset
– contrains
– istrue
– available
• Can nest
– or
– and
– not
Extending $PHING_HOME
|-- bin
|-- classes
• Can extend | `-- phing
| |-- filters
| | `-- util
– Tasks | |-- mappers
– Types |
|
|-- parser
|-- tasks
– Mappers | | |-- ext
| | |-- system
– Ad hoc | | | `-- condition
| | `-- user
| `-- types
|-- docs
| `-- phing_guide
`-- test
|-- classes
`-- etc
Database Deployment
• DbDeploy
– Database change management tool
– Creates script file based on deltas
– Tracks db version
– Easy to move version forward or backwards
– http://dbdeploy.com/
Automate SVN Exports
• Trunk to Dev
– Export diff between last
rev and newest rev
• ‘Release’ Branch to
Testing
– Export diff between last
rev and newest rev
• Tag to
Staging, QA, Prod
– Export diff between last
tag and newest tag
Tagging
• From branch to Tag
– Diff between rev of last
release and last tag of
the same iteration
No challenge in manual busy work. Less attention given.
At the end you get faster, more efficient processes, with less errors.<mention ct deployer?>
Branching, Tagging, and several standalone servers for their own purpose.
Saves you time, don’t need to reinvent the wheel
not build file passed defaults to build.xml in current dirno target name passed defaults to project default target in build file
logical grouping of tasks to achieve a goalmultiple depends with comma delimited
Where the real work happens.Optional are installed through dependencies.You can create your own which will be covered later.
Mention override=“true” to override property values.
Excludes allows excluding files, class, and methods.
ExpandProperty great to replace environment specific variablesFlatten remove directory from filename.Glob is copy/rename.RegExp replaces filename using expression.
Can also have elseif and else.
Talk about ssh keys for scp/ssh
Good when there isn’t a task you need - and rather not create your own.