SlideShare uma empresa Scribd logo
1 de 37
Baixar para ler offline
Oliver Mueller | TEQneers


                Phingified CI and
                Deployment Strategies
Montag, 15. Oktober 12
About Me
                     •   Founder of and CEO at TEQneers [tɛknɪrz]

                     •   Veteran PHP developer

                     •   PHP since 1996 (v2.0)

                     •   Living in Stuttgart, Germany

                     •   like Flying, Photography, NYC




Montag, 15. Oktober 12
TEQneers




Montag, 15. Oktober 12
Agenda
                     •   Introduction to Phing

                     •   Continues Integration

                     •   Deployment Strategy Examples

                     •   Q&A




Montag, 15. Oktober 12
Hands Up!
                     •   Who knows or uses build tools?

                     •   Who is using Continues Integration?




Montag, 15. Oktober 12
Agenda
                     •   Introduction to Phing

                     •   Continues Integration

                     •   Deployment Strategy Examples

                     •   Q&A




Montag, 15. Oktober 12
Phing is not GNU make
                     •   PHP build tool

                     •   based on Apache Ant

                     •   Originally developed by Binarycloud

                     •   Ported to PHP5 by Hans Lellelid

                     •   Lead is Michiel Rook




Montag, 15. Oktober 12
Why use build tools?
                     •   We all hate repetition

                     •   We forget things

                     •   We make mistakes

                     •   We have other things
                         todo

                     •   Be independent of key
                         staff




Montag, 15. Oktober 12
Automate it!
                     •   Helps developers,         •   Improve quality
                         testers, administrators
                                                   •   Reduce errors
                     •   Great for new team
                         members                   •   Save time

                     •   Consolidate scripts

                     •   Standardize tasks

                     •   Define task
                         dependencies


Montag, 15. Oktober 12
Installation
                • Use PEAR
                         # pear channel-discover pear.phing.info
                         # pear install [--alldeps] phing/phing
                • Download package
                         # http://www.phing.info/trac/wiki/Users/Download
                • GIT
                         # git clone git://github.com/phingofficial/phing.git

Montag, 15. Oktober 12
Phing Features
                • Syntax Checks (PhpLint/JsLint)
                • Testing (PHPUnit/SimpleTest)
                • Static code analysis (pdepend)
                • Version Control (SVN/GIT)
                • Documentation (ApiGen/phpDox)
                • File manipulation (mv/rm/chmod)
                • Compression (Zip/Gzip)

Montag, 15. Oktober 12
Montag, 15. Oktober 12
XML Build File
            <?xml version="1.0" encoding="UTF-8" ?>
            <project name="php-git-wrapper" default="test">

                    <!-- PROPERTIES -->
                    <property name="src" value="${project.basedir}/php-git-wrapper" />
                    <property file="build.properties" />

                    <!-- FILESETS -->
                    <fileset dir="${src}/tests" id="tests">
                        <include name="**/*Test.php" />
                        <exclude name="**/Abstracts*.php" />
                    </fileset>

                    <!-- TARGETS -->
                    <target name="prepare" description="Prepare environment" />
                    <target name="test" depends="prepare" description="Start PHPUnit" />
                    <target name="document" description="Generate HTML documentation" />

            </project>



Montag, 15. Oktober 12
Target List
               # phing -l

               Buildfile: /build.xml
                [property] Loading /build.properties
               Default target:
               ------------------------------------------------------
                test      Start PHPUnit Tests

               Main targets:
               ------------------------------------------------------
                document Generate HTML documentation
                prepare   Prepare environment
                test      Start PHPUnit Tests




Montag, 15. Oktober 12
A Closer Look
Montag, 15. Oktober 12
Extending Phing
                     •   Tasks (copy, mkdir, camouflage, ...)

                     •   Types (strings, integer, boolean, DSN, ...)

                     •   Selectors (contain, date, ...)

                     •   Filters (replace, stripwhitespace, ...)

                     •   Mappers (glob, regexp, ...)

                     •   Loggers (xml, html, ...)




Montag, 15. Oktober 12
Agenda
                     •   Introduction to Phing

                     •   Continues Integration

                     •   Deployment Strategy Examples

                     •   Q&A




Montag, 15. Oktober 12
Continues Integration
                     •   Automated build tools

                     •   Short integration phase

                     •   High frequency

                     •   Focus on testing

                     •   Source is XP




Montag, 15. Oktober 12
Standard CI Flow
                         Developer   SVN          CI    Job




                             Ouch!     Failure?        Results
Montag, 15. Oktober 12
Phingify CI




Montag, 15. Oktober 12
Agenda
                     •   Introduction to Phing

                     •   Continues Integration

                     •   Deployment Strategy Examples

                     •   Q&A




Montag, 15. Oktober 12
Deployment
                            All of the activities that make a
                            software system available for use.




                Packaging           Distribution                 Installation


Montag, 15. Oktober 12
What matters
                     •   Product            •   Dependencies

                     •   Project            •   Code size

                     •   Library            •   Configuration
                                                complexity
                     •   Framework

                     •   Open-Source

                     •   Proprietary code




Montag, 15. Oktober 12
Where matters
                     •   Self managed server       •   Cluster

                     •   Local server (intranet)   •   Cloud

                     •   Customer server           •   Appliance

                     •   Multi platform

                     •   Single host

                     •   Server farm




Montag, 15. Oktober 12
Who matters
                     •   Internal administrators

                     •   DevOps

                     •   Customers with IT
                         department

                     •   Some developers

                     •   Trained staff

                     •   Anti geek


Montag, 15. Oktober 12
Deployment Strategies
     Packaging                     Distribution               Installation
   • zip                 • version • ftp          • zookeeper • shell scripts
                           control
   • phar                          • scp          • doozer • composer
   • composer                      • rsync        • noah      • dep / apt-get
   • pear                          • ssh          • accord • rpm / yum
                                   • web page                 • MS WPI
                                                              • chef /
                                                                puppet / juju
Montag, 15. Oktober 12
PEAR
                         <pearpkg2 name="phing" dir="${path.src}">
                            <option name="outputdirectory" value="./build"/>
                            <option name="packagefile" value="package2.xml"/>
                            <option name="packagedirectory" value="./${path.dist}"/>
                            <option name="channel" value="my.pear.channel.com"/>
                            <option name="description" value="${pkg.description}"/>
                            <option name="apiversion" value="${version}"/>
                            <option name="releaseversion" value="${version}"/>
                            <option name="phpdep" value="5.4.0"/>
                            <option name="pearinstallerdep" value="1.4.6"/>
                            <option name="packagetype" value="php"/>
                            <option name="notes" value="${pkg.relnotes}"/>
                            <mapping name="maintainers">
                             <element>
                              <element key="handle" value="foobar"/>
                              <element key="email" value="foobar@teqneers.de"/>
                             </element>
                            </mapping>
                         </pearpkg2>


Montag, 15. Oktober 12
PHAR
                         <pharpackage
                           destfile="${path.build}/package.phar"
                           basedir="./"
                           compression="bzip2">
                           <fileset dir="./classes">
                             <include name="**" />
                           </fileset>
                           <metadata>
                             <element name="version" value="${version}" />
                             <element name="authors">
                               <element name="Foo Bar">
                                 <element name="e-mail" value="foobar@teqneers.de" />
                               </element>
                             </element>
                           </metadata>
                         </pharpackage>




Montag, 15. Oktober 12
MS Web Platform Installer
                         MyApp.zip

                         MyApp root folder           MyApp-includes sub folder

                         Manifest.xml (required)     readme.txt

                         Parameters.xml (required)   license.text

                         Install.sql                 web.config

                         MyApp-admin sub folder      various other files

                         MyApp-content sub folder

Montag, 15. Oktober 12
Composer
                         {
                             "name": "teqneers/PHP-Stream-Wrapper-for-Git",
                             "description": "Git Streamwrapper for PHP",
                             "autoload": { "psr-0": { "TQGit": "src/TQ" } },
                             "type": "library",
                             "license": "MIT",
                             "require": {
                                 "php": ">=5.3.0",
                                 "doctrine/orm": ">=2.2.3,<2.4-dev"
                             },
                             "scripts": {
                                 "post-install-cmd": [
                                     "TQGitSetup::phingInstall"
                                 ],
                                 "post-update-cmd": [
                                     "TQGitSetup::phingUpdate"
                                 ]
                             }
                         }


Montag, 15. Oktober 12
Shell Script
                         #!/bin/sh

                         cd /path/php-git-wrapper
                         unzip php-git-wrapper_1.2.3.zip

                         # copy configuration file to new version
                         copy php-git-wrapper/config.php php-git-wrapper_1.2.3/

                         # remove symlink and set new one
                         rm app
                         ln -s app_1.2.3 app

                         # clean up
                         rm -rf app_1.2.2

                         ...




Montag, 15. Oktober 12
Juju Charm
                         name: php-git-wrapper
                         summary: "PHP-Stream-Wrapper-for-Git"
                         maintainer: "Foo Bar <foobar@teqneers.de>"
                         description: |
                               Install the PHP Stream Wrapper for git,
                               relates to the mysql charm.
                               Can be scaled to multiple server
                         requires:
                           db:
                             interface: mysql
                         provides:
                           proxy: git




Montag, 15. Oktober 12
RPM Build
                         Summary: A PHP stream wrapper made for GIT
                         Name: php-git-wrapper
                         Version: 1.2
                         Release: 3
                         Copyright: GPL
                         Group: Development/Libraries
                         Source: https://github.com/PHP-Stream-Wrapper-for-Git.git
                         URL: https://github.com/teqneers/PHP-Stream-Wrapper-for-Git
                         Distribution: Some Linux
                         Vendor: TEQneers GmbH & Co. KG
                         Packager: Oliver Mueller <oliver@teqneers.de>

                         %description
                         Use it with your projects...
                         %build
                         phing rpm
                         %install
                         phing install
                         %files
                         ...

Montag, 15. Oktober 12
FTP / SCP
                         <ftpdeploy
                           host="your-server-001"
                           username="very"
                           password="secret"
                           dir="/var/www/your-app">
                           <fileset refid="all-files">
                         </ftpdeploy>



                         <scp
                           username="very"
                           password="secret"
                           host="your-server-001"
                           todir="/var/www/your-app">
                           <fileset refid="all-files">
                         </scp>




Montag, 15. Oktober 12
SSH
                         # ask which environment to use
                         <input
                           propertyname="env"
                           validargs="dev,test,prod" />

                         # include file depending on environmnet
                         <property file="properties.${env}"

                         # start update on remote server
                         <ssh
                           username="${login}"
                           password="${password}"
                           host="${server}"
                           command="phing -f /var/www/app/build.xml update" />




Montag, 15. Oktober 12
Q&A
Montag, 15. Oktober 12
Thanks for listening
                            contact me if you have any questions

                                 email: oliver@teqneers.de

                                     twitter: @ogm66

                                  web: www.teqneers.de


                               Have Fun!
Montag, 15. Oktober 12

Mais conteúdo relacionado

Destaque

Carmen Ramos Corrales_Actividad3_curso.doc”
Carmen  Ramos  Corrales_Actividad3_curso.doc”Carmen  Ramos  Corrales_Actividad3_curso.doc”
Carmen Ramos Corrales_Actividad3_curso.doc”Krmen Crc
 
Numbers not Napkins: Simple Startup Metrics
Numbers not Napkins: Simple Startup MetricsNumbers not Napkins: Simple Startup Metrics
Numbers not Napkins: Simple Startup MetricsDave McClure
 
Social Media Bootcamp by Wendy Maynard
Social Media Bootcamp by Wendy MaynardSocial Media Bootcamp by Wendy Maynard
Social Media Bootcamp by Wendy MaynardWendy Maynard
 
Installation and Setup of Lotus Sametime 8.5 ”From Zero to Hero” in Just Two ...
Installation and Setup of Lotus Sametime 8.5 ”From Zero to Hero” in Just Two ...Installation and Setup of Lotus Sametime 8.5 ”From Zero to Hero” in Just Two ...
Installation and Setup of Lotus Sametime 8.5 ”From Zero to Hero” in Just Two ...jackdowning
 
La confiance des Français dans le numérique - Baromètre ACSEL / CDC
La confiance des Français dans le numérique - Baromètre ACSEL / CDCLa confiance des Français dans le numérique - Baromètre ACSEL / CDC
La confiance des Français dans le numérique - Baromètre ACSEL / CDCLuc Mandret
 
Cum pierd timpul angajatii tai
Cum pierd timpul angajatii taiCum pierd timpul angajatii tai
Cum pierd timpul angajatii taiRadu Popa
 
Proyecto Academia Supera-T
Proyecto Academia Supera-TProyecto Academia Supera-T
Proyecto Academia Supera-TMaria Belen Pm
 
Presentacion villalba sostenible
Presentacion villalba sosteniblePresentacion villalba sostenible
Presentacion villalba sostenibleFernandoArribas
 
Instructivo para la presentacion de informe final del proyecto
Instructivo para la presentacion de informe final del proyectoInstructivo para la presentacion de informe final del proyecto
Instructivo para la presentacion de informe final del proyectokattybe
 
Papel actual del fonoaudiologo en educacion y familia
Papel actual del fonoaudiologo en educacion y familiaPapel actual del fonoaudiologo en educacion y familia
Papel actual del fonoaudiologo en educacion y familiaNestor Pardo
 
Guia de trabajos practicos
Guia de trabajos practicosGuia de trabajos practicos
Guia de trabajos practicosruthemartina
 
Red de Business Angels InnoBAN
Red de Business Angels InnoBANRed de Business Angels InnoBAN
Red de Business Angels InnoBANTokApp School
 
Revista
RevistaRevista
Revistaampa
 
Centenario De La Gran Via, Madrid
Centenario De La Gran Via, MadridCentenario De La Gran Via, Madrid
Centenario De La Gran Via, MadridJ. Lorea
 
Problem Solving with Critical Thinking
Problem Solving with Critical ThinkingProblem Solving with Critical Thinking
Problem Solving with Critical ThinkingSARCTutor
 
Ecosense new linear slim cove INT CAD Drawing
Ecosense new linear slim cove INT CAD DrawingEcosense new linear slim cove INT CAD Drawing
Ecosense new linear slim cove INT CAD Drawingvalorlighting
 
The Art of Self-Coaching
The Art of Self-CoachingThe Art of Self-Coaching
The Art of Self-CoachingEd Batista
 

Destaque (20)

VENTA DE CABINA DE AUDIOMETRIA
VENTA DE CABINA DE AUDIOMETRIAVENTA DE CABINA DE AUDIOMETRIA
VENTA DE CABINA DE AUDIOMETRIA
 
Carmen Ramos Corrales_Actividad3_curso.doc”
Carmen  Ramos  Corrales_Actividad3_curso.doc”Carmen  Ramos  Corrales_Actividad3_curso.doc”
Carmen Ramos Corrales_Actividad3_curso.doc”
 
BCI & Plan B DR best practice presentation 110914
BCI &  Plan B DR best practice presentation 110914BCI &  Plan B DR best practice presentation 110914
BCI & Plan B DR best practice presentation 110914
 
Numbers not Napkins: Simple Startup Metrics
Numbers not Napkins: Simple Startup MetricsNumbers not Napkins: Simple Startup Metrics
Numbers not Napkins: Simple Startup Metrics
 
Social Media Bootcamp by Wendy Maynard
Social Media Bootcamp by Wendy MaynardSocial Media Bootcamp by Wendy Maynard
Social Media Bootcamp by Wendy Maynard
 
Installation and Setup of Lotus Sametime 8.5 ”From Zero to Hero” in Just Two ...
Installation and Setup of Lotus Sametime 8.5 ”From Zero to Hero” in Just Two ...Installation and Setup of Lotus Sametime 8.5 ”From Zero to Hero” in Just Two ...
Installation and Setup of Lotus Sametime 8.5 ”From Zero to Hero” in Just Two ...
 
La confiance des Français dans le numérique - Baromètre ACSEL / CDC
La confiance des Français dans le numérique - Baromètre ACSEL / CDCLa confiance des Français dans le numérique - Baromètre ACSEL / CDC
La confiance des Français dans le numérique - Baromètre ACSEL / CDC
 
Cum pierd timpul angajatii tai
Cum pierd timpul angajatii taiCum pierd timpul angajatii tai
Cum pierd timpul angajatii tai
 
Proyecto Academia Supera-T
Proyecto Academia Supera-TProyecto Academia Supera-T
Proyecto Academia Supera-T
 
Presentacion villalba sostenible
Presentacion villalba sosteniblePresentacion villalba sostenible
Presentacion villalba sostenible
 
Instructivo para la presentacion de informe final del proyecto
Instructivo para la presentacion de informe final del proyectoInstructivo para la presentacion de informe final del proyecto
Instructivo para la presentacion de informe final del proyecto
 
Papel actual del fonoaudiologo en educacion y familia
Papel actual del fonoaudiologo en educacion y familiaPapel actual del fonoaudiologo en educacion y familia
Papel actual del fonoaudiologo en educacion y familia
 
Guia de trabajos practicos
Guia de trabajos practicosGuia de trabajos practicos
Guia de trabajos practicos
 
Red de Business Angels InnoBAN
Red de Business Angels InnoBANRed de Business Angels InnoBAN
Red de Business Angels InnoBAN
 
Revista
RevistaRevista
Revista
 
Centenario De La Gran Via, Madrid
Centenario De La Gran Via, MadridCentenario De La Gran Via, Madrid
Centenario De La Gran Via, Madrid
 
Problem Solving with Critical Thinking
Problem Solving with Critical ThinkingProblem Solving with Critical Thinking
Problem Solving with Critical Thinking
 
Ecosense new linear slim cove INT CAD Drawing
Ecosense new linear slim cove INT CAD DrawingEcosense new linear slim cove INT CAD Drawing
Ecosense new linear slim cove INT CAD Drawing
 
The Art of Self-Coaching
The Art of Self-CoachingThe Art of Self-Coaching
The Art of Self-Coaching
 
Microfilamentos de Actina
Microfilamentos de ActinaMicrofilamentos de Actina
Microfilamentos de Actina
 

Semelhante a Phingified ci and deployment strategies ipc 2012

Confgetti - Put A Leash On Your Configuration!
Confgetti - Put A Leash On Your Configuration!Confgetti - Put A Leash On Your Configuration!
Confgetti - Put A Leash On Your Configuration!Nikola Tuckovic
 
Deploying your SaaS stack OnPrem
Deploying your SaaS stack OnPremDeploying your SaaS stack OnPrem
Deploying your SaaS stack OnPremKris Buytaert
 
Parallel Programming in Python: Speeding up your analysis
Parallel Programming in Python: Speeding up your analysisParallel Programming in Python: Speeding up your analysis
Parallel Programming in Python: Speeding up your analysisManojit Nandi
 
meetup version of Paving the road to production
  meetup version of Paving the road to production    meetup version of Paving the road to production
meetup version of Paving the road to production Matthew Reynolds
 
Smart Platform Infrastructure with AWS
Smart Platform Infrastructure with AWSSmart Platform Infrastructure with AWS
Smart Platform Infrastructure with AWSJames Huston
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersSPC Adriatics
 
Devoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National PoliceDevoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National PoliceBert Jan Schrijver
 
C4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web FrameworkC4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web FrameworkFrancis Addai
 
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Demi Ben-Ari
 
Get There meetup March 2018 - Microservices in action at the Dutch National P...
Get There meetup March 2018 - Microservices in action at the Dutch National P...Get There meetup March 2018 - Microservices in action at the Dutch National P...
Get There meetup March 2018 - Microservices in action at the Dutch National P...Bert Jan Schrijver
 
Dublin JUG February 2018 - Microservices in action at the Dutch National Police
Dublin JUG February 2018 - Microservices in action at the Dutch National PoliceDublin JUG February 2018 - Microservices in action at the Dutch National Police
Dublin JUG February 2018 - Microservices in action at the Dutch National PoliceBert Jan Schrijver
 
Manage your ODI Development Cycle – ODTUG Webinar
Manage your ODI Development Cycle – ODTUG WebinarManage your ODI Development Cycle – ODTUG Webinar
Manage your ODI Development Cycle – ODTUG WebinarJérôme Françoisse
 
Dev ops lessons learned - Michael Collins
Dev ops lessons learned  - Michael CollinsDev ops lessons learned  - Michael Collins
Dev ops lessons learned - Michael CollinsDevopsdays
 
iSense Java Summit 2017 - Microservices in action at the Dutch National Police
iSense Java Summit 2017 - Microservices in action at the Dutch National PoliceiSense Java Summit 2017 - Microservices in action at the Dutch National Police
iSense Java Summit 2017 - Microservices in action at the Dutch National PoliceBert Jan Schrijver
 
Using Grunt with Drupal
Using Grunt with DrupalUsing Grunt with Drupal
Using Grunt with Drupalarithmetric
 
What Industry and Research can learn from Open Source
What Industry and Research can learn from Open SourceWhat Industry and Research can learn from Open Source
What Industry and Research can learn from Open SourceRalph Mueller
 

Semelhante a Phingified ci and deployment strategies ipc 2012 (20)

Confgetti - Put A Leash On Your Configuration!
Confgetti - Put A Leash On Your Configuration!Confgetti - Put A Leash On Your Configuration!
Confgetti - Put A Leash On Your Configuration!
 
Deploying your SaaS stack OnPrem
Deploying your SaaS stack OnPremDeploying your SaaS stack OnPrem
Deploying your SaaS stack OnPrem
 
Parallel Programming in Python: Speeding up your analysis
Parallel Programming in Python: Speeding up your analysisParallel Programming in Python: Speeding up your analysis
Parallel Programming in Python: Speeding up your analysis
 
meetup version of Paving the road to production
  meetup version of Paving the road to production    meetup version of Paving the road to production
meetup version of Paving the road to production
 
Smart Platform Infrastructure with AWS
Smart Platform Infrastructure with AWSSmart Platform Infrastructure with AWS
Smart Platform Infrastructure with AWS
 
Lean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill AyersLean-Agile Development with SharePoint - Bill Ayers
Lean-Agile Development with SharePoint - Bill Ayers
 
Devoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National PoliceDevoxx PL 2018 - Microservices in action at the Dutch National Police
Devoxx PL 2018 - Microservices in action at the Dutch National Police
 
C4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web FrameworkC4ainaction-Introduction to the Pyramid Web Framework
C4ainaction-Introduction to the Pyramid Web Framework
 
SKS in git ops mode
SKS in git ops modeSKS in git ops mode
SKS in git ops mode
 
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
 
Get There meetup March 2018 - Microservices in action at the Dutch National P...
Get There meetup March 2018 - Microservices in action at the Dutch National P...Get There meetup March 2018 - Microservices in action at the Dutch National P...
Get There meetup March 2018 - Microservices in action at the Dutch National P...
 
Dublin JUG February 2018 - Microservices in action at the Dutch National Police
Dublin JUG February 2018 - Microservices in action at the Dutch National PoliceDublin JUG February 2018 - Microservices in action at the Dutch National Police
Dublin JUG February 2018 - Microservices in action at the Dutch National Police
 
Enterprise PHP
Enterprise PHPEnterprise PHP
Enterprise PHP
 
GitOps , done Right
GitOps , done RightGitOps , done Right
GitOps , done Right
 
Manage your ODI Development Cycle – ODTUG Webinar
Manage your ODI Development Cycle – ODTUG WebinarManage your ODI Development Cycle – ODTUG Webinar
Manage your ODI Development Cycle – ODTUG Webinar
 
Dev ops lessons learned - Michael Collins
Dev ops lessons learned  - Michael CollinsDev ops lessons learned  - Michael Collins
Dev ops lessons learned - Michael Collins
 
iSense Java Summit 2017 - Microservices in action at the Dutch National Police
iSense Java Summit 2017 - Microservices in action at the Dutch National PoliceiSense Java Summit 2017 - Microservices in action at the Dutch National Police
iSense Java Summit 2017 - Microservices in action at the Dutch National Police
 
Using Grunt with Drupal
Using Grunt with DrupalUsing Grunt with Drupal
Using Grunt with Drupal
 
What Industry and Research can learn from Open Source
What Industry and Research can learn from Open SourceWhat Industry and Research can learn from Open Source
What Industry and Research can learn from Open Source
 
Stackato
StackatoStackato
Stackato
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Último (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Phingified ci and deployment strategies ipc 2012

  • 1. Oliver Mueller | TEQneers Phingified CI and Deployment Strategies Montag, 15. Oktober 12
  • 2. About Me • Founder of and CEO at TEQneers [tɛknɪrz] • Veteran PHP developer • PHP since 1996 (v2.0) • Living in Stuttgart, Germany • like Flying, Photography, NYC Montag, 15. Oktober 12
  • 4. Agenda • Introduction to Phing • Continues Integration • Deployment Strategy Examples • Q&A Montag, 15. Oktober 12
  • 5. Hands Up! • Who knows or uses build tools? • Who is using Continues Integration? Montag, 15. Oktober 12
  • 6. Agenda • Introduction to Phing • Continues Integration • Deployment Strategy Examples • Q&A Montag, 15. Oktober 12
  • 7. Phing is not GNU make • PHP build tool • based on Apache Ant • Originally developed by Binarycloud • Ported to PHP5 by Hans Lellelid • Lead is Michiel Rook Montag, 15. Oktober 12
  • 8. Why use build tools? • We all hate repetition • We forget things • We make mistakes • We have other things todo • Be independent of key staff Montag, 15. Oktober 12
  • 9. Automate it! • Helps developers, • Improve quality testers, administrators • Reduce errors • Great for new team members • Save time • Consolidate scripts • Standardize tasks • Define task dependencies Montag, 15. Oktober 12
  • 10. Installation • Use PEAR # pear channel-discover pear.phing.info # pear install [--alldeps] phing/phing • Download package # http://www.phing.info/trac/wiki/Users/Download • GIT # git clone git://github.com/phingofficial/phing.git Montag, 15. Oktober 12
  • 11. Phing Features • Syntax Checks (PhpLint/JsLint) • Testing (PHPUnit/SimpleTest) • Static code analysis (pdepend) • Version Control (SVN/GIT) • Documentation (ApiGen/phpDox) • File manipulation (mv/rm/chmod) • Compression (Zip/Gzip) Montag, 15. Oktober 12
  • 13. XML Build File <?xml version="1.0" encoding="UTF-8" ?> <project name="php-git-wrapper" default="test"> <!-- PROPERTIES --> <property name="src" value="${project.basedir}/php-git-wrapper" /> <property file="build.properties" /> <!-- FILESETS --> <fileset dir="${src}/tests" id="tests"> <include name="**/*Test.php" /> <exclude name="**/Abstracts*.php" /> </fileset> <!-- TARGETS --> <target name="prepare" description="Prepare environment" /> <target name="test" depends="prepare" description="Start PHPUnit" /> <target name="document" description="Generate HTML documentation" /> </project> Montag, 15. Oktober 12
  • 14. Target List # phing -l Buildfile: /build.xml [property] Loading /build.properties Default target: ------------------------------------------------------ test Start PHPUnit Tests Main targets: ------------------------------------------------------ document Generate HTML documentation prepare Prepare environment test Start PHPUnit Tests Montag, 15. Oktober 12
  • 15. A Closer Look Montag, 15. Oktober 12
  • 16. Extending Phing • Tasks (copy, mkdir, camouflage, ...) • Types (strings, integer, boolean, DSN, ...) • Selectors (contain, date, ...) • Filters (replace, stripwhitespace, ...) • Mappers (glob, regexp, ...) • Loggers (xml, html, ...) Montag, 15. Oktober 12
  • 17. Agenda • Introduction to Phing • Continues Integration • Deployment Strategy Examples • Q&A Montag, 15. Oktober 12
  • 18. Continues Integration • Automated build tools • Short integration phase • High frequency • Focus on testing • Source is XP Montag, 15. Oktober 12
  • 19. Standard CI Flow Developer SVN CI Job Ouch! Failure? Results Montag, 15. Oktober 12
  • 21. Agenda • Introduction to Phing • Continues Integration • Deployment Strategy Examples • Q&A Montag, 15. Oktober 12
  • 22. Deployment All of the activities that make a software system available for use. Packaging Distribution Installation Montag, 15. Oktober 12
  • 23. What matters • Product • Dependencies • Project • Code size • Library • Configuration complexity • Framework • Open-Source • Proprietary code Montag, 15. Oktober 12
  • 24. Where matters • Self managed server • Cluster • Local server (intranet) • Cloud • Customer server • Appliance • Multi platform • Single host • Server farm Montag, 15. Oktober 12
  • 25. Who matters • Internal administrators • DevOps • Customers with IT department • Some developers • Trained staff • Anti geek Montag, 15. Oktober 12
  • 26. Deployment Strategies Packaging Distribution Installation • zip • version • ftp • zookeeper • shell scripts control • phar • scp • doozer • composer • composer • rsync • noah • dep / apt-get • pear • ssh • accord • rpm / yum • web page • MS WPI • chef / puppet / juju Montag, 15. Oktober 12
  • 27. PEAR <pearpkg2 name="phing" dir="${path.src}"> <option name="outputdirectory" value="./build"/> <option name="packagefile" value="package2.xml"/> <option name="packagedirectory" value="./${path.dist}"/> <option name="channel" value="my.pear.channel.com"/> <option name="description" value="${pkg.description}"/> <option name="apiversion" value="${version}"/> <option name="releaseversion" value="${version}"/> <option name="phpdep" value="5.4.0"/> <option name="pearinstallerdep" value="1.4.6"/> <option name="packagetype" value="php"/> <option name="notes" value="${pkg.relnotes}"/> <mapping name="maintainers"> <element> <element key="handle" value="foobar"/> <element key="email" value="foobar@teqneers.de"/> </element> </mapping> </pearpkg2> Montag, 15. Oktober 12
  • 28. PHAR <pharpackage destfile="${path.build}/package.phar" basedir="./" compression="bzip2"> <fileset dir="./classes"> <include name="**" /> </fileset> <metadata> <element name="version" value="${version}" /> <element name="authors"> <element name="Foo Bar"> <element name="e-mail" value="foobar@teqneers.de" /> </element> </element> </metadata> </pharpackage> Montag, 15. Oktober 12
  • 29. MS Web Platform Installer MyApp.zip MyApp root folder MyApp-includes sub folder Manifest.xml (required) readme.txt Parameters.xml (required) license.text Install.sql web.config MyApp-admin sub folder various other files MyApp-content sub folder Montag, 15. Oktober 12
  • 30. Composer {     "name": "teqneers/PHP-Stream-Wrapper-for-Git",     "description": "Git Streamwrapper for PHP",     "autoload": { "psr-0": { "TQGit": "src/TQ" } }, "type": "library",     "license": "MIT",     "require": {         "php": ">=5.3.0",         "doctrine/orm": ">=2.2.3,<2.4-dev"     },     "scripts": {         "post-install-cmd": [             "TQGitSetup::phingInstall"         ],         "post-update-cmd": [             "TQGitSetup::phingUpdate"         ]     } } Montag, 15. Oktober 12
  • 31. Shell Script #!/bin/sh cd /path/php-git-wrapper unzip php-git-wrapper_1.2.3.zip # copy configuration file to new version copy php-git-wrapper/config.php php-git-wrapper_1.2.3/ # remove symlink and set new one rm app ln -s app_1.2.3 app # clean up rm -rf app_1.2.2 ... Montag, 15. Oktober 12
  • 32. Juju Charm name: php-git-wrapper summary: "PHP-Stream-Wrapper-for-Git" maintainer: "Foo Bar <foobar@teqneers.de>" description: | Install the PHP Stream Wrapper for git, relates to the mysql charm. Can be scaled to multiple server requires: db: interface: mysql provides: proxy: git Montag, 15. Oktober 12
  • 33. RPM Build Summary: A PHP stream wrapper made for GIT Name: php-git-wrapper Version: 1.2 Release: 3 Copyright: GPL Group: Development/Libraries Source: https://github.com/PHP-Stream-Wrapper-for-Git.git URL: https://github.com/teqneers/PHP-Stream-Wrapper-for-Git Distribution: Some Linux Vendor: TEQneers GmbH & Co. KG Packager: Oliver Mueller <oliver@teqneers.de> %description Use it with your projects... %build phing rpm %install phing install %files ... Montag, 15. Oktober 12
  • 34. FTP / SCP <ftpdeploy host="your-server-001" username="very" password="secret" dir="/var/www/your-app"> <fileset refid="all-files"> </ftpdeploy> <scp username="very" password="secret" host="your-server-001" todir="/var/www/your-app"> <fileset refid="all-files"> </scp> Montag, 15. Oktober 12
  • 35. SSH # ask which environment to use <input propertyname="env" validargs="dev,test,prod" /> # include file depending on environmnet <property file="properties.${env}" # start update on remote server <ssh username="${login}" password="${password}" host="${server}" command="phing -f /var/www/app/build.xml update" /> Montag, 15. Oktober 12
  • 37. Thanks for listening contact me if you have any questions email: oliver@teqneers.de twitter: @ogm66 web: www.teqneers.de Have Fun! Montag, 15. Oktober 12