SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Taming     the


                                Deployment
                                Beast        DallasPHP - Dallas, TX
                                             08.11.2009


Monday, August 17, 2009
What is Deployment?

                                HERE                THERE


               The fun part is what happens in between...
                          - technology
                          - configuration
                          - coordination
                          - an increase in sanity

                                                            20090716-01
Monday, August 17, 2009
What’s included in Deployment?
                     - code testing
                     - building documentation
                     - checking permissions
                     - check coding standards
                     - updates/uninstall of components
                     - notifications




                                                         20090716-02
Monday, August 17, 2009
Thinking Environmentally
                          Development
                          Environment for application development (includes version control, unit testing, lint checks)


                          Quality Assurance/Testing
                          Environment for testing applications and ensuring all is functioning well


                          Staging
                          Environment immediately prior to deployment to production, checkout of current files
                          marked for "production"


                          Production
                          Environment for public consumption



                                                                                                                          20090716-02
Monday, August 17, 2009
Don’t Forget the Testing
                          Integration
                          Unit/other tests designed to identify potential errors with the communication
                          between pieces of functionality

                          Acceptance/System
                          Run "in browser" to validate functionality of the applications

                          Compatibility
                          Ensuring that the software will work with all platforms involved

                          Performance
                          Checking performance of the application on all sides

                          Security
                          Verifying that no security issues exist in the code for any stage in the process


                                                                                                             20090716-04
Monday, August 17, 2009
Version Control Makes it Simple
                          CVS
                          Version control system, each file has its own version number, uses tags and
                          pseudo branches for code separation


                          Subversion
                          Version control system, repository has overall version number, uses tags/
                          branches for code separation


                          Git
                          Version control system, each checkout is a full repository in its own right,
                          allows for offline commits, updates/merges once connected




                                                                                                         20090716-03
Monday, August 17, 2009
Build it Out
                          Phing
                          PHP-based build tool, automates the build process for a site to be deployed.
                          XML-based build file for simple management (PHP)


                          Ant
                          Apache's build tool, designed for flexibility for multiple deployment types.
                          XML-based configuration files (Java)


                          Capistrano
                          Tool for automation of tasks on multiple servers (as opposed to just a local build).
                          Allows for rollbacks. (Ruby)




                                                                                                                 20090716-05
Monday, August 17, 2009
Document Your Code
                          phpDocumentor
                           Uses code comments to build documentation
                           Examples:
                           /**
                           * This library (MyLib) provides this bit of functionality
                           * @author Chris Cornutt <ccornutt@phpdeveloper.org>
                           * @package mylibs
                           */
                           class MyLib { }
                           //------------------
                           /**
                           * This method takes in things and outputs others
                           * @param array $arr_in Input Array
                           * @param string $str_in Input String
                           * @return object $obj_out Output object
                           */
                           public function myMethod($arr_in,$str_in,$obj_out){
                               return $obj_out;
                           }




                          Wiki software (like MediaWiki)
                           Used by Wikipedia
                           Document the “why”, not really the “how”
                           Easy to get out of control
                                                                                       20090716-04
Monday, August 17, 2009
Frontend Testing
                          Selenium
                           Firefox extension
                           Session recording for typing, clicks, etc
                           Three flavors: Selenium IDE, Selenium Remote Control, Seleium Grid
                           Multiple browser support (IE, Firefox, Safari, Chrome)



                          WebTests
                           Based on an Ant build process
                           Build XML-based repeatable tests
                           Worries more about the page than how its rendered
                           Output reports on test results




                                                                                               20090716-04
Monday, August 17, 2009
Continuous Integration
                          phpUnderControl (CruiseControl)
                            CruiseControl is Java-based, but build tools for Ant, Phing, Rake, etc
                            Plugins for git, svn, cvs
                            Output methods include emails, ftp, http, jabber, etc

                            pUc adds integration for things like PHPUnit, phpDocumentor, PHP_CodeSniffer
                            Chart output for unit test coverage, coding violations, timeline



                          Xinc (Native PHP)
                            Written in PHP5 with built-in SVN support
                            Stats output for build status, testing summary, duration
                            Installable via PEAR




                                                                                                          20090716-04
Monday, August 17, 2009
Syntax Tools
                      Tidy
                          Extension for PHP (http://php.net/tidy)
                          Parsing XML and HTML
                          Can specify a custom configuration file
                          CleanRepair is your best friend


                      PHP_CodeSniffer
                          Reduces the code to “tokens” & checks location, surroundings to ensure compliance
                          Comes with default “sniffs” - PEAR, PHPCS, Zend, Squiz
                          Command line tool: phpcs

                          FILE: /path/to/code/myfile.php
                          --------------------------------------------------------------------------------
                          FOUND 5 ERROR(S) AND 1 WARNING(S) AFFECTING 5 LINE(S)
                          --------------------------------------------------------------------------------
                            2 | ERROR   | Missing file doc comment
                           20 | ERROR   | PHP keywords must be lowercase; expected "false" but found
                              |         | "FALSE"
                           88 | ERROR   | Line not indented correctly; expected 9 spaces but found 6
                          --------------------------------------------------------------------------------
                                                                                                              20090716-04
Monday, August 17, 2009
Deployment Options
                          SVN (svn up)   PEAR installer
                          ssh/scp        phar packages
                          rsync
                          ftp/sftp       Other manual/automatic process




                                                                          20090716-05
Monday, August 17, 2009
Enough Talk
                      It’s Time for Some Action


                                                  20090716-05
Monday, August 17, 2009
Overview
                                          Phing / Ant
                                               Unit             Build
                                svn co         Test             Docs             rsync
                          DEV                                                            PROD
                                                Lint             Code
                                               Check           Standard

                                                   Subversion
                                                     PHPUnit
                                                 phpDocumentor
                                                    PHP’s lint
                                                 PHP_CodeSniffer
                                                      rsync



                                         Zip     DB
                                               Deploy   PEAR      Report   Tar
                                                                                                20090716-05
Monday, August 17, 2009
Step 1 - Planning
                          What do we have right now?
                          What business processes/workflows need to be
                          considered?
                          Which technologies would we need to invest in?
                          What’s our release schedule?

                          Who’s going to run this thing?




                                                                           20090716-05
Monday, August 17, 2009
Step 2 - Development
                          Single place to pull from
                          (You do use version control, right?)


                          Example:
                          Subversion environment with developer branches as well as QA and
                          PROD branches. PROD branch is “the point”.


                                                         QA
                                                                                    PROD

                                                               DEV



                                                                                             20090716-05
Monday, August 17, 2009
Step 3 - The Build
                          Determine the steps you’ll need
                          Think Easy
                          Server builds are good + Local build is even better



                          Example:
                          Phing configuration that includes an anonymous checkout of the latest from the repository,
                          a run of all unit tests for the project, generate the docs via phpDocumentor, check the syntax of
                          all files and run an rsync script to push it out live.




                                                                                                                              20090716-05
Monday, August 17, 2009
Step 3 - The Build (Phing)
               <?xml version=”1.0”>
               <project name=”deploy_me” default=”main”>
                  <property name=”version” value=”1.0” />

                  <target name=”unittest”>
                     <phpunit>
                         <batchtest>
                            <fileset dir=”/www/mysite/tests”>
                               <include name=”**/*Test*.php” />
                            </fileset>
                         </batchtest>
                     </phpunit>
                  </target>
                  <target name=”phpdoc” depends=”unittest”>
                     <phpdoc title=”MySite Documentation” destdir=”/www/mysite/docs” output=”HTML:Smarty:PHP”>
                         <fileset dir=”/www/mysite/docroot”>
                            <include name=”**/*.php” />
                         </fileset>
                     </phpdoc>
                  </target>
                  <target name=”lintme” depends=”phpdoc”>
                     <phplint>
                         <fileset dir=”/www/mysite/docroot”>
                            <include name=”**/*.php” />
                         </fileset>
                     </phplint>
                  </target>
                  <target name=”standardsplz” depends=”lintme”>
                     <phpcodesniffer standard=”PEAR” format=”summary” file=”/www/mysite/docroot”
                         allowedFileExtensions=”php php5 inc” />
                  </target>
                  <target name=”main” depends=”standardsplz”>
                  </target>
               </project>

                                                                                                           20090716-05
Monday, August 17, 2009
Step 3 - The Build (Ant)
               <?xml version=”1.0”>
               <project name="deploy_me" default="main" basedir=".">
                    <property name="version" value="1.0"/>

                    <target name="unittest">
                          <exec dir="${basedir}/source" executable="phpunit" failonerror="true">
                               <arg line="--log-xml ${basedir}/build/logs/testlog.xml"/>
                          </exec>
                    </target>
                    <target name="phpdoc" depends="unittest">
                          <exec executable="phpdoc" dir="${basedir}/source">
                               <arg line="-ct type -ue on -t ${basedir}/build/api -tb /PATH/TO/YOUR/PHPUC/DATA/phpdoc -o
               HTML:Phpuc:phpuc -d src/"/>
                          </exec>
                    </target>
                    <target name="lintme" depends="phpdoc">
                    </target>
                    <target name="standardsplz" depends="lintme">
                          <exec executable="phpcs" dir="${basedir}/source" output="${basedir}/build/logs/checkstyle.xml">
                               <arg line="--report=checkstyle --standard=PEAR --ignore=src/autoload src/"/>
                          </exec>
                    </target>
                    <target name="main" depends="standardsplz">
                    </target>
               </project>




                                                                                                            20090716-05
Monday, August 17, 2009
Step 4 - The Push
                          Where’s “here” and where’s “there”?
                          And what’s in between that could cause issues...


                          Pick the right tools & process for you
                          Things to consider: network config, what’s already in use (piggyback on a protocol?)


                          Ready...Set...Wait
                          Do you have everything you need? Is the staging environment ready?




                                                                                                                20090716-05
Monday, August 17, 2009
Step 4 - The Push (cont.)
                                               SVN         FTP/SFTP
                                               RSYNC       Capistrano
                                    2%
                                 4%2%          SSH/SCP     Ant
                            4%                 Automatic   Cut & Paste
                          4%                   Manual
                      5%
                                         47%
                   11%




                             21%




                                                                   20090716-05
Monday, August 17, 2009
Step 5 - The Aftermath
                          Clean up your mess, young man
                          This is where post-push belongs, wrap it all up


                          Make sure dev is ready to do it all again
                          Deployment should be simple and automatic


                          Giving the “All Clear”
                          Be sure to run your tests to ensure that all is happy in production.




                                                                                                 20090716-05
Monday, August 17, 2009
The Point of it All
                          Like flipping a switch, a good build should make
                          deploying your website a simple task, no matter
                          the complexity.

                          It should remove the burden of repetitive tasks
                          from developers and make lives easier.




                                                                            20090716-05
Monday, August 17, 2009
Questions,
                           Comments,
                          Suggestions?
                           ccornutt@phpdeveloper.org

                           @enygma

                           http://blog.phpdeveloper.org




                                                          20090716-05
Monday, August 17, 2009

Contenu connexe

En vedette

Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012Combell NV
 
The top 10 web application intrusion techniques
The top 10 web application intrusion techniquesThe top 10 web application intrusion techniques
The top 10 web application intrusion techniquesAntonio Fontes
 
JavaScript Tools (PHPConference 2011, Berlin)
JavaScript Tools (PHPConference 2011, Berlin)JavaScript Tools (PHPConference 2011, Berlin)
JavaScript Tools (PHPConference 2011, Berlin)wolframkriesing
 
The Original Hypertext Preprocessor
The Original Hypertext PreprocessorThe Original Hypertext Preprocessor
The Original Hypertext PreprocessorDrew McLellan
 
Von Dinosauriern, Bienen und Wespen
Von Dinosauriern, Bienen und WespenVon Dinosauriern, Bienen und Wespen
Von Dinosauriern, Bienen und WespenTomas Caspers
 
The Contextual Experience of the Mobile Web
The Contextual Experience of the Mobile WebThe Contextual Experience of the Mobile Web
The Contextual Experience of the Mobile WebJeff Carouth
 
Pragmatic Guide to Git
Pragmatic Guide to GitPragmatic Guide to Git
Pragmatic Guide to GitConFoo
 

En vedette (7)

Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012Develop and deploy using Hybrid Cloud Strategies confoo2012
Develop and deploy using Hybrid Cloud Strategies confoo2012
 
The top 10 web application intrusion techniques
The top 10 web application intrusion techniquesThe top 10 web application intrusion techniques
The top 10 web application intrusion techniques
 
JavaScript Tools (PHPConference 2011, Berlin)
JavaScript Tools (PHPConference 2011, Berlin)JavaScript Tools (PHPConference 2011, Berlin)
JavaScript Tools (PHPConference 2011, Berlin)
 
The Original Hypertext Preprocessor
The Original Hypertext PreprocessorThe Original Hypertext Preprocessor
The Original Hypertext Preprocessor
 
Von Dinosauriern, Bienen und Wespen
Von Dinosauriern, Bienen und WespenVon Dinosauriern, Bienen und Wespen
Von Dinosauriern, Bienen und Wespen
 
The Contextual Experience of the Mobile Web
The Contextual Experience of the Mobile WebThe Contextual Experience of the Mobile Web
The Contextual Experience of the Mobile Web
 
Pragmatic Guide to Git
Pragmatic Guide to GitPragmatic Guide to Git
Pragmatic Guide to Git
 

Similaire à Taming the Deployment Beast

Flash Camp Chennai - Build automation of Flex and AIR applications
Flash Camp Chennai - Build automation of Flex and AIR applicationsFlash Camp Chennai - Build automation of Flex and AIR applications
Flash Camp Chennai - Build automation of Flex and AIR applicationsRIA RUI Society
 
New Generation Record/Playback Tools for AJAX Testing
New Generation Record/Playback Tools for AJAX TestingNew Generation Record/Playback Tools for AJAX Testing
New Generation Record/Playback Tools for AJAX TestingClever Moe
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics TutorialClever Moe
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)danielputerman
 
Migrating from HP QuickTest Pro QTP to TestMaker Object Designer
Migrating from HP QuickTest Pro QTP to TestMaker Object DesignerMigrating from HP QuickTest Pro QTP to TestMaker Object Designer
Migrating from HP QuickTest Pro QTP to TestMaker Object DesignerClever Moe
 
Migrating From HP QTP To TestMaker 6
Migrating From HP QTP To TestMaker 6Migrating From HP QTP To TestMaker 6
Migrating From HP QTP To TestMaker 6Clever Moe
 
Software testing tools
Software testing toolsSoftware testing tools
Software testing toolsGaurav Paliwal
 
Website Testing Practices
Website Testing PracticesWebsite Testing Practices
Website Testing Practicesdeseomar
 
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYury M
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaAmazon Web Services
 
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with AppiumSrijan Technologies
 
Stateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystemsStateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystemsNuno Caneco
 
Selenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI TestingSelenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI Testingmikereedell
 
Complexity is Outside the Code - Craft Conference
Complexity is Outside the Code - Craft ConferenceComplexity is Outside the Code - Craft Conference
Complexity is Outside the Code - Craft Conferencejessitron
 
End to-end testing from rookie to pro
End to-end testing  from rookie to proEnd to-end testing  from rookie to pro
End to-end testing from rookie to proDomenico Gemoli
 
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfBuilding And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfpCloudy
 
An Overview of Selenium
An Overview of SeleniumAn Overview of Selenium
An Overview of Seleniumadamcarmi
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationRobot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationSauce Labs
 

Similaire à Taming the Deployment Beast (20)

Flash Camp Chennai - Build automation of Flex and AIR applications
Flash Camp Chennai - Build automation of Flex and AIR applicationsFlash Camp Chennai - Build automation of Flex and AIR applications
Flash Camp Chennai - Build automation of Flex and AIR applications
 
New Generation Record/Playback Tools for AJAX Testing
New Generation Record/Playback Tools for AJAX TestingNew Generation Record/Playback Tools for AJAX Testing
New Generation Record/Playback Tools for AJAX Testing
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)
 
Migrating from HP QuickTest Pro QTP to TestMaker Object Designer
Migrating from HP QuickTest Pro QTP to TestMaker Object DesignerMigrating from HP QuickTest Pro QTP to TestMaker Object Designer
Migrating from HP QuickTest Pro QTP to TestMaker Object Designer
 
Migrating From HP QTP To TestMaker 6
Migrating From HP QTP To TestMaker 6Migrating From HP QTP To TestMaker 6
Migrating From HP QTP To TestMaker 6
 
Software testing tools
Software testing toolsSoftware testing tools
Software testing tools
 
Website Testing Practices
Website Testing PracticesWebsite Testing Practices
Website Testing Practices
 
What's new in p2 (2009)?
What's new in p2 (2009)?What's new in p2 (2009)?
What's new in p2 (2009)?
 
Testing Toolbox
Testing ToolboxTesting Toolbox
Testing Toolbox
 
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
 
Stateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystemsStateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystems
 
Selenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI TestingSelenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI Testing
 
Complexity is Outside the Code - Craft Conference
Complexity is Outside the Code - Craft ConferenceComplexity is Outside the Code - Craft Conference
Complexity is Outside the Code - Craft Conference
 
End to-end testing from rookie to pro
End to-end testing  from rookie to proEnd to-end testing  from rookie to pro
End to-end testing from rookie to pro
 
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdfBuilding And Executing Test Cases with Appium and Various Test Frameworks.pdf
Building And Executing Test Cases with Appium and Various Test Frameworks.pdf
 
An Overview of Selenium
An Overview of SeleniumAn Overview of Selenium
An Overview of Selenium
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationRobot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs Integration
 

Dernier

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Dernier (20)

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Taming the Deployment Beast

  • 1. Taming the Deployment Beast DallasPHP - Dallas, TX 08.11.2009 Monday, August 17, 2009
  • 2. What is Deployment? HERE THERE The fun part is what happens in between... - technology - configuration - coordination - an increase in sanity 20090716-01 Monday, August 17, 2009
  • 3. What’s included in Deployment? - code testing - building documentation - checking permissions - check coding standards - updates/uninstall of components - notifications 20090716-02 Monday, August 17, 2009
  • 4. Thinking Environmentally Development Environment for application development (includes version control, unit testing, lint checks) Quality Assurance/Testing Environment for testing applications and ensuring all is functioning well Staging Environment immediately prior to deployment to production, checkout of current files marked for "production" Production Environment for public consumption 20090716-02 Monday, August 17, 2009
  • 5. Don’t Forget the Testing Integration Unit/other tests designed to identify potential errors with the communication between pieces of functionality Acceptance/System Run "in browser" to validate functionality of the applications Compatibility Ensuring that the software will work with all platforms involved Performance Checking performance of the application on all sides Security Verifying that no security issues exist in the code for any stage in the process 20090716-04 Monday, August 17, 2009
  • 6. Version Control Makes it Simple CVS Version control system, each file has its own version number, uses tags and pseudo branches for code separation Subversion Version control system, repository has overall version number, uses tags/ branches for code separation Git Version control system, each checkout is a full repository in its own right, allows for offline commits, updates/merges once connected 20090716-03 Monday, August 17, 2009
  • 7. Build it Out Phing PHP-based build tool, automates the build process for a site to be deployed. XML-based build file for simple management (PHP) Ant Apache's build tool, designed for flexibility for multiple deployment types. XML-based configuration files (Java) Capistrano Tool for automation of tasks on multiple servers (as opposed to just a local build). Allows for rollbacks. (Ruby) 20090716-05 Monday, August 17, 2009
  • 8. Document Your Code phpDocumentor Uses code comments to build documentation Examples: /** * This library (MyLib) provides this bit of functionality * @author Chris Cornutt <ccornutt@phpdeveloper.org> * @package mylibs */ class MyLib { } //------------------ /** * This method takes in things and outputs others * @param array $arr_in Input Array * @param string $str_in Input String * @return object $obj_out Output object */ public function myMethod($arr_in,$str_in,$obj_out){ return $obj_out; } Wiki software (like MediaWiki) Used by Wikipedia Document the “why”, not really the “how” Easy to get out of control 20090716-04 Monday, August 17, 2009
  • 9. Frontend Testing Selenium Firefox extension Session recording for typing, clicks, etc Three flavors: Selenium IDE, Selenium Remote Control, Seleium Grid Multiple browser support (IE, Firefox, Safari, Chrome) WebTests Based on an Ant build process Build XML-based repeatable tests Worries more about the page than how its rendered Output reports on test results 20090716-04 Monday, August 17, 2009
  • 10. Continuous Integration phpUnderControl (CruiseControl) CruiseControl is Java-based, but build tools for Ant, Phing, Rake, etc Plugins for git, svn, cvs Output methods include emails, ftp, http, jabber, etc pUc adds integration for things like PHPUnit, phpDocumentor, PHP_CodeSniffer Chart output for unit test coverage, coding violations, timeline Xinc (Native PHP) Written in PHP5 with built-in SVN support Stats output for build status, testing summary, duration Installable via PEAR 20090716-04 Monday, August 17, 2009
  • 11. Syntax Tools Tidy Extension for PHP (http://php.net/tidy) Parsing XML and HTML Can specify a custom configuration file CleanRepair is your best friend PHP_CodeSniffer Reduces the code to “tokens” & checks location, surroundings to ensure compliance Comes with default “sniffs” - PEAR, PHPCS, Zend, Squiz Command line tool: phpcs FILE: /path/to/code/myfile.php -------------------------------------------------------------------------------- FOUND 5 ERROR(S) AND 1 WARNING(S) AFFECTING 5 LINE(S) -------------------------------------------------------------------------------- 2 | ERROR | Missing file doc comment 20 | ERROR | PHP keywords must be lowercase; expected "false" but found | | "FALSE" 88 | ERROR | Line not indented correctly; expected 9 spaces but found 6 -------------------------------------------------------------------------------- 20090716-04 Monday, August 17, 2009
  • 12. Deployment Options SVN (svn up) PEAR installer ssh/scp phar packages rsync ftp/sftp Other manual/automatic process 20090716-05 Monday, August 17, 2009
  • 13. Enough Talk It’s Time for Some Action 20090716-05 Monday, August 17, 2009
  • 14. Overview Phing / Ant Unit Build svn co Test Docs rsync DEV PROD Lint Code Check Standard Subversion PHPUnit phpDocumentor PHP’s lint PHP_CodeSniffer rsync Zip DB Deploy PEAR Report Tar 20090716-05 Monday, August 17, 2009
  • 15. Step 1 - Planning What do we have right now? What business processes/workflows need to be considered? Which technologies would we need to invest in? What’s our release schedule? Who’s going to run this thing? 20090716-05 Monday, August 17, 2009
  • 16. Step 2 - Development Single place to pull from (You do use version control, right?) Example: Subversion environment with developer branches as well as QA and PROD branches. PROD branch is “the point”. QA PROD DEV 20090716-05 Monday, August 17, 2009
  • 17. Step 3 - The Build Determine the steps you’ll need Think Easy Server builds are good + Local build is even better Example: Phing configuration that includes an anonymous checkout of the latest from the repository, a run of all unit tests for the project, generate the docs via phpDocumentor, check the syntax of all files and run an rsync script to push it out live. 20090716-05 Monday, August 17, 2009
  • 18. Step 3 - The Build (Phing) <?xml version=”1.0”> <project name=”deploy_me” default=”main”> <property name=”version” value=”1.0” /> <target name=”unittest”> <phpunit> <batchtest> <fileset dir=”/www/mysite/tests”> <include name=”**/*Test*.php” /> </fileset> </batchtest> </phpunit> </target> <target name=”phpdoc” depends=”unittest”> <phpdoc title=”MySite Documentation” destdir=”/www/mysite/docs” output=”HTML:Smarty:PHP”> <fileset dir=”/www/mysite/docroot”> <include name=”**/*.php” /> </fileset> </phpdoc> </target> <target name=”lintme” depends=”phpdoc”> <phplint> <fileset dir=”/www/mysite/docroot”> <include name=”**/*.php” /> </fileset> </phplint> </target> <target name=”standardsplz” depends=”lintme”> <phpcodesniffer standard=”PEAR” format=”summary” file=”/www/mysite/docroot” allowedFileExtensions=”php php5 inc” /> </target> <target name=”main” depends=”standardsplz”> </target> </project> 20090716-05 Monday, August 17, 2009
  • 19. Step 3 - The Build (Ant) <?xml version=”1.0”> <project name="deploy_me" default="main" basedir="."> <property name="version" value="1.0"/> <target name="unittest"> <exec dir="${basedir}/source" executable="phpunit" failonerror="true"> <arg line="--log-xml ${basedir}/build/logs/testlog.xml"/> </exec> </target> <target name="phpdoc" depends="unittest"> <exec executable="phpdoc" dir="${basedir}/source"> <arg line="-ct type -ue on -t ${basedir}/build/api -tb /PATH/TO/YOUR/PHPUC/DATA/phpdoc -o HTML:Phpuc:phpuc -d src/"/> </exec> </target> <target name="lintme" depends="phpdoc"> </target> <target name="standardsplz" depends="lintme"> <exec executable="phpcs" dir="${basedir}/source" output="${basedir}/build/logs/checkstyle.xml"> <arg line="--report=checkstyle --standard=PEAR --ignore=src/autoload src/"/> </exec> </target> <target name="main" depends="standardsplz"> </target> </project> 20090716-05 Monday, August 17, 2009
  • 20. Step 4 - The Push Where’s “here” and where’s “there”? And what’s in between that could cause issues... Pick the right tools & process for you Things to consider: network config, what’s already in use (piggyback on a protocol?) Ready...Set...Wait Do you have everything you need? Is the staging environment ready? 20090716-05 Monday, August 17, 2009
  • 21. Step 4 - The Push (cont.) SVN FTP/SFTP RSYNC Capistrano 2% 4%2% SSH/SCP Ant 4% Automatic Cut & Paste 4% Manual 5% 47% 11% 21% 20090716-05 Monday, August 17, 2009
  • 22. Step 5 - The Aftermath Clean up your mess, young man This is where post-push belongs, wrap it all up Make sure dev is ready to do it all again Deployment should be simple and automatic Giving the “All Clear” Be sure to run your tests to ensure that all is happy in production. 20090716-05 Monday, August 17, 2009
  • 23. The Point of it All Like flipping a switch, a good build should make deploying your website a simple task, no matter the complexity. It should remove the burden of repetitive tasks from developers and make lives easier. 20090716-05 Monday, August 17, 2009
  • 24. Questions, Comments, Suggestions? ccornutt@phpdeveloper.org @enygma http://blog.phpdeveloper.org 20090716-05 Monday, August 17, 2009