SlideShare uma empresa Scribd logo
1 de 45
Baixar para ler offline
Versioning for developers
            Michelangelo van Dam
   Macq Electronique 2010 Brussels, Belgium
Michelangelo van Dam

• Independent Consultant
• Zend Certified Engineer (ZCE)
 - PHP 4 & PHP 5
 - Zend Framework
• Co-Founder of PHPBenelux
• Shepherd of “elephpant” herds
T AIL O RM A D E S O L U T I O N S




                                         Macq électronique, manufacturer and developer, proposes
                                         you a whole series of electronic and computing-processing
                                         solutions for industry, building and road traffic.

                                         Macq électronique has set itself two objectives which are
                                         essential for our company :

                                              developing with competence and innovation
                                              earning the confidence of our customers

                                         Macq électronique presents many references carried out
                                         the last few years which attest to its human and
                                         technical abilities to meet with the greatest efficiency
                                         the needs of its customers.




For more information, please check out our website
              http://www.macqel.eu
About this presentation
• Concepts of version control
• Management with subversion
• Life cycle of a project in subversion
• Parts and structures within subversion
• Advanced subversion tools
• New in release 1.5
What is version control ?


“Revision control (also known as version control ...) is
the management of multiple revisions of the same unit
of information.”
(source: Wikipedia:RevisionControl)
Versioning for developers
•- version control provides
    management of versions of information
   • code/tests
   • configuration files
 -
   • documentation
     in a structured, standardized way
 -   with repositories
     • centralized (SVN, CVS)
     • decentralized (GIT)
Why need versioning ?
• enables collaboration between developers
• centralized “main code” (trunk)
• custom code alongside main code (branching)
• eases release management (tags)
• rollback to previous revisions
• integration with other tools
Subversion (SVN)
• Subversion (http://subversion.tigris.org)
• more advanced than CVS
• less complex than GIT
• integrates well with other tools
  (trac, gforge, jira, ...)
• supported by many tools
  (Zend Studio, TortoiseSVN, Subversion CLI)
An example project in trac
SVN browser Zend Studio
Code managing with SVN
• many developers create much code
•- code is committed to a central repository
    conflicts trigger warnings
• user and groups can be defined
• different versions can co-exist
• access management for named and anonymous
  access rights
Subversion authentication
• svnserve server
  $ svn svn://server/project/trunk
• svnserve server over SSH
  $ svn svn+ssh://server/project/trunk
• Apache webserver
  http://svn.server/project/trunk
Version management
• all code resides in “trunk”
• code revisions are detached in “branches”
• snapshots for releases are “tagged”
Subversion Schema
Putting a project into SVN
Say you’ve started project FooBar with following files:
/FooBar
   /Foo.php
   /Bar.php

To put it on a Subversion repository:
$ svn import -m “new project” FooBar http://svn.server/
FooBar/trunk
Getting code from SVN
A new team member needs to work on the FooBar project

He needs to get the project from Subversion

To get it from a Subversion repository:
$ svn checkout http://svn.server/FooBar/trunk FooBar

This will fetch the latest revision (HEAD) from the TRUNK
and creates a local FooBar directory
Updating code in SVN
After a well deserved holiday, you need to continue working
on the FooBar project

You need to get updates of the project from Subversion

To update your working copy from Subversion repository:
$ svn update /FooBar

This will update your working copy with the latest revision
(HEAD) from the TRUNK
Committing back to SVN
You’re working hard on FooBar and you need to commit
your changes back to Subversion.

To commit changes back to Subversion repository:
$ svn commit -m “Added some cool stuff”

This will commit changes in your code to the TRUNK.
Best practice


   Update before committing
    Update after committing
Commit small development chunks
        Commit often
Release management
• a release is a snapshot of a version branch
• are being deployed to server environments
   (DEV, TEST, ACC, PROD, ...)
•- 2 common methods to release code
     symlink deployment
 -   subversion export
Symlink Deployment
•- On production server(s):
   use release folders
   svn co svn://server/myproj/tags/rel-1.0 /web/
   myproj-rel-1.0
 - create symlink to it
   ln -s /web/myproj-rel-1.0 /web/myproj
• Pro:
 - simple
• Contra:
 - renaming folders on server
 - enabling FollowSymlinks
Subversion Export
• Exporting a release from subversion
  svn export http://svn.server/project/tags/
  release-1.0.2
• Pro:
 - scheduled (automated) upgrades possible
 - no further modifications necessary
• Contra:
 - takes longer to switch back to previous release
SVN life cycle
                        feature branch

        v1.0 v1.1
Trunk
                                         bug fix

                            rel-1.1.1       rel-1.1.2

                    rel-1.0.1       rel-1.0.2
Trunk
•- trunk is where all code resides
     except custom development
• has always the latest version
• is not always the most stable version
Branch
•- two kind of branches exists
     feature branches
 -   release branches
Feature Branches
• code that changes many things in trunk
• are best put in a separate branch
• maintained by their developer(s)
•- and merged back into trunk
    after the merge, the branch is removed
• when changes are done and tested
Release Branches
• are maintained in branches
• have a long lifetime cycle (several years)
•- differ from each other
    because of new code base, framework, language
• have a common base = trunk
• fixes from versions go into trunk
• back port fixes go from trunk into version
Tags
• tags are snapshots
• usually made on version branches
• can also be made on “trunk”
• are deployed to server environments
• are used to keep track what’s happened between
  releases (change log)
More than just versioning
•- Subversion provides more features
     File portability
 -   Keyword substitution
 -   Locking
 -   Externals
 -   Peg and Operative revisions
 -   Network model
 -   Hooks
File portability
•- Line endings differ on different OS’s
     are ignored when checking modifications
•- Mime-types differ from their extensions
    binary and non-binary files are tested on content
Keyword substitution
•- Only a few keywords are substituted
     $Date:$ › $Date: 2008-10-22 20:00:00 +0100
     (Wed, 22 Oct 2008) $
 -   $Revision:$ › $Revision: 144 $
 -   $Author:$ › $Author: svnusername $
 -   $HeadUrl:$ › $HeadUrl: http://svn.test.be/trunk $
 -   $Id:$ › $Id: file.php 148 2008-10-22 20:00:00Z
     svnusername $
Locking
•- working copy locks
   exclusive right to a working copy
 - clears with “svn cleanup”
• database locks
 - ensures database integrity
 - only admins can remove this lock

• conflicts with the purpose of revision control
Externals
•- Externals provide an easy way to
   include other internal or external projects
 - without having to care about their revisions
• Examples:
 - Zend Framework as svn:externals on library path
 - project that includes many smaller projects
Peg & Operative revisions
•- automated handling of
   moving files
 - deleting and creating new files with same name
• Using specific syntax
 - $ svn command -r OPERATIVE-REV item@PEG-
   REV
Network model
•- Can run its own svnserve
   pros: no dependencies, works with ssh for extra
   security
 - contras: need svnclient to connect
• Or in combination with Apache webserver
 - pros: works with any http-client
 - contras: overkill for small projects, requires
   mod_dav_svn, more difficult to set up
Hooks
•- Hooks facilitate actions to be taken
   before a commit starts (validate rights)
 - after a commit (send e-mail, update tracker, ...)
 - before or after a revision change (notifications)
• Can easily be incorporated with tools
 - tracking tools
 - integration tools (Lorna Jane’s Nabaztag)
 - mailing and logging systems
Hooks execute moments
•- basic commit moments:
    start-commit:
   • runs before commit transaction started
 - pre-commit:
   • runs right before commit transaction is
        promoted
 -   post-commit:

 -
   •    runs after the commit transaction is finished
     ...
Cool things w/ SVN hooks
   Lorna Jane’s Nabaztag
                     Responding on SVN commits




http://www.flickr.com/photos/lornajane/2592602734/
Automated builds
•- With SVN and Phing (PHP Build tool)
     nightly checkout of code base
 -   running tools to enhance code
   •  PHPDocumentator (automated API docs)
   •  PHP_CodeSniffer (checks code for standards)
   •  PHPLint (checks code for syntax errors)
   •  PHPUnit (unit testing for PHP)

 -
   •  …
     creating a package (including docs, tests, reports)
New features in SVN v1.5
• Merge tracking (foundational)
• Sparse checkouts (via new --depth option)
• Interactive conflict resolution
• Changelist support
• Relative URLs, peg revisions in svn:externals
• Cyrus SASL support for ra_svn and svnserve
• ... (more on http://subversion.tigris.org/
  svn_1.5_releasenotes.html)
Summary
• manageable file change history
• better collaboration between developers
• clearer release management
• more than one version of same code base
• easier to rollback in case of emergency
Recommended Reading
  Version Control with Subversion, 2nd Edition
  (O’Reilley Media, Inc)

  by C. Michael Pilato; Ben Collins-Sussman; Brian W. Fitzpatrick

  also online: http://svnbook.red-bean.com




  Managing Software Development with Trac and Subversion
  (Packt Publishing)

  by David J Murphy
Recommended Reading
  Subversion Version Control:
  Using the Subversion Version Control System in Development Projects
  (Bruce Perens' Open Source Series)

  by William Nagel
Credits


                    Wikipedia Logo
http://commons.wikimedia.org/wiki/File:Wikipedia-logo.png
Thank you !


         Slides on Slideshare
http://www.slideshare.net/group/macqel

      Give feedback on Joind.in
         http://joind.in/1260

Mais conteúdo relacionado

Mais procurados

Atril-Déjà Vu Tea mserver 2 general presentation
Atril-Déjà Vu Tea mserver 2   general presentationAtril-Déjà Vu Tea mserver 2   general presentation
Atril-Déjà Vu Tea mserver 2 general presentationcohlmann
 
Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2Michal Ziarnik
 
Version Control with Subversion
Version Control with SubversionVersion Control with Subversion
Version Control with SubversionGuy K. Kloss
 
SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best PracticesAshraf Fouad
 
Part 4 - Managing your svn repository using jas forge
Part 4  - Managing your svn repository using jas forgePart 4  - Managing your svn repository using jas forge
Part 4 - Managing your svn repository using jas forgeJasmine Conseil
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovskyphp-user-group-minsk
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best PracticesMaidul Islam
 
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2Qualcomm Developer Network
 
Pipeline based deployments on Jenkins
Pipeline based deployments  on JenkinsPipeline based deployments  on Jenkins
Pipeline based deployments on JenkinsKnoldus Inc.
 
Ankit Chohan - Java
Ankit Chohan - JavaAnkit Chohan - Java
Ankit Chohan - JavaAnkit Chohan
 
Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101Malcolm Groves
 
Testing fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornosTesting fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornosMicael Gallego
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftYaniv cohen
 
SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practicesabackstrom
 
BKK16-205 RDK-B IoT
BKK16-205 RDK-B IoTBKK16-205 RDK-B IoT
BKK16-205 RDK-B IoTLinaro
 
What is the merge window?
What is the merge window?What is the merge window?
What is the merge window?Macpaul Lin
 

Mais procurados (20)

Atril-Déjà Vu Tea mserver 2 general presentation
Atril-Déjà Vu Tea mserver 2   general presentationAtril-Déjà Vu Tea mserver 2   general presentation
Atril-Déjà Vu Tea mserver 2 general presentation
 
Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2
 
Version Control with Subversion
Version Control with SubversionVersion Control with Subversion
Version Control with Subversion
 
SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
 
Part 4 - Managing your svn repository using jas forge
Part 4  - Managing your svn repository using jas forgePart 4  - Managing your svn repository using jas forge
Part 4 - Managing your svn repository using jas forge
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovsky
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
 
svn
svnsvn
svn
 
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 2
 
Pipeline based deployments on Jenkins
Pipeline based deployments  on JenkinsPipeline based deployments  on Jenkins
Pipeline based deployments on Jenkins
 
Svn Basic Tutorial
Svn Basic TutorialSvn Basic Tutorial
Svn Basic Tutorial
 
Ankit Chohan - Java
Ankit Chohan - JavaAnkit Chohan - Java
Ankit Chohan - Java
 
Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101
 
Testing fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornosTesting fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornos
 
SVN Basics
SVN BasicsSVN Basics
SVN Basics
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
 
SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practices
 
BKK16-205 RDK-B IoT
BKK16-205 RDK-B IoTBKK16-205 RDK-B IoT
BKK16-205 RDK-B IoT
 
SUSE KVM Ecosystem
SUSE KVM EcosystemSUSE KVM Ecosystem
SUSE KVM Ecosystem
 
What is the merge window?
What is the merge window?What is the merge window?
What is the merge window?
 

Destaque

Distributed Version Control Systems in the Enterprise - Atlassian Summit 2010
Distributed Version Control Systems in the Enterprise - Atlassian Summit 2010Distributed Version Control Systems in the Enterprise - Atlassian Summit 2010
Distributed Version Control Systems in the Enterprise - Atlassian Summit 2010Atlassian
 
A brief introduction to version control systems
A brief introduction to version control systemsA brief introduction to version control systems
A brief introduction to version control systemsTim Staley
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & GitCraig Smith
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?Leonid Mamchenkov
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control SystemKMS Technology
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version ControlJeremy Coates
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to gitJoel Krebs
 

Destaque (10)

Distributed Version Control Systems in the Enterprise - Atlassian Summit 2010
Distributed Version Control Systems in the Enterprise - Atlassian Summit 2010Distributed Version Control Systems in the Enterprise - Atlassian Summit 2010
Distributed Version Control Systems in the Enterprise - Atlassian Summit 2010
 
Subversion
SubversionSubversion
Subversion
 
A brief introduction to version control systems
A brief introduction to version control systemsA brief introduction to version control systems
A brief introduction to version control systems
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?
 
Intro To Git
Intro To GitIntro To Git
Intro To Git
 
Alfresco in an hour
Alfresco in an hourAlfresco in an hour
Alfresco in an hour
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
 

Semelhante a Versioning for Developers

Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkinsecubemarketing
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous IntegrationGeff Henderson Chang
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps JumpstartOri Donner
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With SubversionSamnang Chhun
 
Continuous Deployment into the Unknown with Artifactory, Bintray, Docker and ...
Continuous Deployment into the Unknown with Artifactory, Bintray, Docker and ...Continuous Deployment into the Unknown with Artifactory, Bintray, Docker and ...
Continuous Deployment into the Unknown with Artifactory, Bintray, Docker and ...Gilad Garon
 
Source control - what you need to know
Source control - what you need to knowSource control - what you need to know
Source control - what you need to knowdaveymni
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Mandi Walls
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...E. Camden Fisher
 
Mantis Code Deployment Process
Mantis Code Deployment ProcessMantis Code Deployment Process
Mantis Code Deployment ProcessJen Wei Lee
 
223: Modernization and Migrating from the ESB to Containers
223: Modernization and Migrating from the ESB to Containers223: Modernization and Migrating from the ESB to Containers
223: Modernization and Migrating from the ESB to ContainersTrevor Dolby
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 WorkflowsRyan Street
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013dotCloud
 
Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)
Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)
Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)ITCamp
 
321 codeincontainer brewbox
321 codeincontainer brewbox321 codeincontainer brewbox
321 codeincontainer brewboxLino Telera
 
Open Audit
Open AuditOpen Audit
Open Auditncspa
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack SummitMiguel Zuniga
 
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Chocolatey Software
 
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Michel Buczynski
 

Semelhante a Versioning for Developers (20)

Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkins
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous Integration
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps Jumpstart
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With Subversion
 
Continuous Deployment into the Unknown with Artifactory, Bintray, Docker and ...
Continuous Deployment into the Unknown with Artifactory, Bintray, Docker and ...Continuous Deployment into the Unknown with Artifactory, Bintray, Docker and ...
Continuous Deployment into the Unknown with Artifactory, Bintray, Docker and ...
 
Source control - what you need to know
Source control - what you need to knowSource control - what you need to know
Source control - what you need to know
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
 
Mantis Code Deployment Process
Mantis Code Deployment ProcessMantis Code Deployment Process
Mantis Code Deployment Process
 
223: Modernization and Migrating from the ESB to Containers
223: Modernization and Migrating from the ESB to Containers223: Modernization and Migrating from the ESB to Containers
223: Modernization and Migrating from the ESB to Containers
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
 
Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)
Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)
Deep Dive into the Microsoft OpenStack CI Infrastructure (Alessandro Pilotti)
 
321 codeincontainer brewbox
321 codeincontainer brewbox321 codeincontainer brewbox
321 codeincontainer brewbox
 
Open Audit
Open AuditOpen Audit
Open Audit
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack Summit
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
 
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
 

Mais de Michelangelo van Dam

GDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and defaultGDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and defaultMichelangelo van Dam
 
Moving from app services to azure functions
Moving from app services to azure functionsMoving from app services to azure functions
Moving from app services to azure functionsMichelangelo van Dam
 
General Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's storyGeneral Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's storyMichelangelo van Dam
 
Leveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantageLeveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantageMichelangelo van Dam
 
Open source for a successful business
Open source for a successful businessOpen source for a successful business
Open source for a successful businessMichelangelo van Dam
 
Decouple your framework now, thank me later
Decouple your framework now, thank me laterDecouple your framework now, thank me later
Decouple your framework now, thank me laterMichelangelo van Dam
 
Deploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutesDeploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutesMichelangelo van Dam
 
Azure and OSS, a match made in heaven
Azure and OSS, a match made in heavenAzure and OSS, a match made in heaven
Azure and OSS, a match made in heavenMichelangelo van Dam
 
Zf2 how arrays will save your project
Zf2   how arrays will save your projectZf2   how arrays will save your project
Zf2 how arrays will save your projectMichelangelo van Dam
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsMichelangelo van Dam
 
Easily extend your existing php app with an api
Easily extend your existing php app with an apiEasily extend your existing php app with an api
Easily extend your existing php app with an apiMichelangelo van Dam
 

Mais de Michelangelo van Dam (20)

GDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and defaultGDPR Art. 25 - Privacy by design and default
GDPR Art. 25 - Privacy by design and default
 
Moving from app services to azure functions
Moving from app services to azure functionsMoving from app services to azure functions
Moving from app services to azure functions
 
Privacy by design
Privacy by designPrivacy by design
Privacy by design
 
DevOps or DevSecOps
DevOps or DevSecOpsDevOps or DevSecOps
DevOps or DevSecOps
 
Privacy by design
Privacy by designPrivacy by design
Privacy by design
 
Continuous deployment 2.0
Continuous deployment 2.0Continuous deployment 2.0
Continuous deployment 2.0
 
Let your tests drive your code
Let your tests drive your codeLet your tests drive your code
Let your tests drive your code
 
General Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's storyGeneral Data Protection Regulation, a developer's story
General Data Protection Regulation, a developer's story
 
Leveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantageLeveraging a distributed architecture to your advantage
Leveraging a distributed architecture to your advantage
 
The road to php 7.1
The road to php 7.1The road to php 7.1
The road to php 7.1
 
Open source for a successful business
Open source for a successful businessOpen source for a successful business
Open source for a successful business
 
Decouple your framework now, thank me later
Decouple your framework now, thank me laterDecouple your framework now, thank me later
Decouple your framework now, thank me later
 
Deploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutesDeploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutes
 
Azure and OSS, a match made in heaven
Azure and OSS, a match made in heavenAzure and OSS, a match made in heaven
Azure and OSS, a match made in heaven
 
Getting hands dirty with php7
Getting hands dirty with php7Getting hands dirty with php7
Getting hands dirty with php7
 
Zf2 how arrays will save your project
Zf2   how arrays will save your projectZf2   how arrays will save your project
Zf2 how arrays will save your project
 
Create, test, secure, repeat
Create, test, secure, repeatCreate, test, secure, repeat
Create, test, secure, repeat
 
The Continuous PHP Pipeline
The Continuous PHP PipelineThe Continuous PHP Pipeline
The Continuous PHP Pipeline
 
PHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the testsPHPUnit Episode iv.iii: Return of the tests
PHPUnit Episode iv.iii: Return of the tests
 
Easily extend your existing php app with an api
Easily extend your existing php app with an apiEasily extend your existing php app with an api
Easily extend your existing php app with an api
 

Último

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
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
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
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
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Último (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
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!
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
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
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.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
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

Versioning for Developers

  • 1. Versioning for developers Michelangelo van Dam Macq Electronique 2010 Brussels, Belgium
  • 2. Michelangelo van Dam • Independent Consultant • Zend Certified Engineer (ZCE) - PHP 4 & PHP 5 - Zend Framework • Co-Founder of PHPBenelux • Shepherd of “elephpant” herds
  • 3. T AIL O RM A D E S O L U T I O N S Macq électronique, manufacturer and developer, proposes you a whole series of electronic and computing-processing solutions for industry, building and road traffic. Macq électronique has set itself two objectives which are essential for our company : developing with competence and innovation earning the confidence of our customers Macq électronique presents many references carried out the last few years which attest to its human and technical abilities to meet with the greatest efficiency the needs of its customers. For more information, please check out our website http://www.macqel.eu
  • 4. About this presentation • Concepts of version control • Management with subversion • Life cycle of a project in subversion • Parts and structures within subversion • Advanced subversion tools • New in release 1.5
  • 5. What is version control ? “Revision control (also known as version control ...) is the management of multiple revisions of the same unit of information.” (source: Wikipedia:RevisionControl)
  • 6. Versioning for developers •- version control provides management of versions of information • code/tests • configuration files - • documentation in a structured, standardized way - with repositories • centralized (SVN, CVS) • decentralized (GIT)
  • 7. Why need versioning ? • enables collaboration between developers • centralized “main code” (trunk) • custom code alongside main code (branching) • eases release management (tags) • rollback to previous revisions • integration with other tools
  • 8. Subversion (SVN) • Subversion (http://subversion.tigris.org) • more advanced than CVS • less complex than GIT • integrates well with other tools (trac, gforge, jira, ...) • supported by many tools (Zend Studio, TortoiseSVN, Subversion CLI)
  • 11. Code managing with SVN • many developers create much code •- code is committed to a central repository conflicts trigger warnings • user and groups can be defined • different versions can co-exist • access management for named and anonymous access rights
  • 12. Subversion authentication • svnserve server $ svn svn://server/project/trunk • svnserve server over SSH $ svn svn+ssh://server/project/trunk • Apache webserver http://svn.server/project/trunk
  • 13. Version management • all code resides in “trunk” • code revisions are detached in “branches” • snapshots for releases are “tagged”
  • 15. Putting a project into SVN Say you’ve started project FooBar with following files: /FooBar /Foo.php /Bar.php To put it on a Subversion repository: $ svn import -m “new project” FooBar http://svn.server/ FooBar/trunk
  • 16. Getting code from SVN A new team member needs to work on the FooBar project He needs to get the project from Subversion To get it from a Subversion repository: $ svn checkout http://svn.server/FooBar/trunk FooBar This will fetch the latest revision (HEAD) from the TRUNK and creates a local FooBar directory
  • 17. Updating code in SVN After a well deserved holiday, you need to continue working on the FooBar project You need to get updates of the project from Subversion To update your working copy from Subversion repository: $ svn update /FooBar This will update your working copy with the latest revision (HEAD) from the TRUNK
  • 18. Committing back to SVN You’re working hard on FooBar and you need to commit your changes back to Subversion. To commit changes back to Subversion repository: $ svn commit -m “Added some cool stuff” This will commit changes in your code to the TRUNK.
  • 19. Best practice Update before committing Update after committing Commit small development chunks Commit often
  • 20. Release management • a release is a snapshot of a version branch • are being deployed to server environments (DEV, TEST, ACC, PROD, ...) •- 2 common methods to release code symlink deployment - subversion export
  • 21. Symlink Deployment •- On production server(s): use release folders svn co svn://server/myproj/tags/rel-1.0 /web/ myproj-rel-1.0 - create symlink to it ln -s /web/myproj-rel-1.0 /web/myproj • Pro: - simple • Contra: - renaming folders on server - enabling FollowSymlinks
  • 22. Subversion Export • Exporting a release from subversion svn export http://svn.server/project/tags/ release-1.0.2 • Pro: - scheduled (automated) upgrades possible - no further modifications necessary • Contra: - takes longer to switch back to previous release
  • 23. SVN life cycle feature branch v1.0 v1.1 Trunk bug fix rel-1.1.1 rel-1.1.2 rel-1.0.1 rel-1.0.2
  • 24. Trunk •- trunk is where all code resides except custom development • has always the latest version • is not always the most stable version
  • 25. Branch •- two kind of branches exists feature branches - release branches
  • 26. Feature Branches • code that changes many things in trunk • are best put in a separate branch • maintained by their developer(s) •- and merged back into trunk after the merge, the branch is removed • when changes are done and tested
  • 27. Release Branches • are maintained in branches • have a long lifetime cycle (several years) •- differ from each other because of new code base, framework, language • have a common base = trunk • fixes from versions go into trunk • back port fixes go from trunk into version
  • 28. Tags • tags are snapshots • usually made on version branches • can also be made on “trunk” • are deployed to server environments • are used to keep track what’s happened between releases (change log)
  • 29. More than just versioning •- Subversion provides more features File portability - Keyword substitution - Locking - Externals - Peg and Operative revisions - Network model - Hooks
  • 30. File portability •- Line endings differ on different OS’s are ignored when checking modifications •- Mime-types differ from their extensions binary and non-binary files are tested on content
  • 31. Keyword substitution •- Only a few keywords are substituted $Date:$ › $Date: 2008-10-22 20:00:00 +0100 (Wed, 22 Oct 2008) $ - $Revision:$ › $Revision: 144 $ - $Author:$ › $Author: svnusername $ - $HeadUrl:$ › $HeadUrl: http://svn.test.be/trunk $ - $Id:$ › $Id: file.php 148 2008-10-22 20:00:00Z svnusername $
  • 32. Locking •- working copy locks exclusive right to a working copy - clears with “svn cleanup” • database locks - ensures database integrity - only admins can remove this lock • conflicts with the purpose of revision control
  • 33. Externals •- Externals provide an easy way to include other internal or external projects - without having to care about their revisions • Examples: - Zend Framework as svn:externals on library path - project that includes many smaller projects
  • 34. Peg & Operative revisions •- automated handling of moving files - deleting and creating new files with same name • Using specific syntax - $ svn command -r OPERATIVE-REV item@PEG- REV
  • 35. Network model •- Can run its own svnserve pros: no dependencies, works with ssh for extra security - contras: need svnclient to connect • Or in combination with Apache webserver - pros: works with any http-client - contras: overkill for small projects, requires mod_dav_svn, more difficult to set up
  • 36. Hooks •- Hooks facilitate actions to be taken before a commit starts (validate rights) - after a commit (send e-mail, update tracker, ...) - before or after a revision change (notifications) • Can easily be incorporated with tools - tracking tools - integration tools (Lorna Jane’s Nabaztag) - mailing and logging systems
  • 37. Hooks execute moments •- basic commit moments: start-commit: • runs before commit transaction started - pre-commit: • runs right before commit transaction is promoted - post-commit: - • runs after the commit transaction is finished ...
  • 38. Cool things w/ SVN hooks Lorna Jane’s Nabaztag Responding on SVN commits http://www.flickr.com/photos/lornajane/2592602734/
  • 39. Automated builds •- With SVN and Phing (PHP Build tool) nightly checkout of code base - running tools to enhance code • PHPDocumentator (automated API docs) • PHP_CodeSniffer (checks code for standards) • PHPLint (checks code for syntax errors) • PHPUnit (unit testing for PHP) - • … creating a package (including docs, tests, reports)
  • 40. New features in SVN v1.5 • Merge tracking (foundational) • Sparse checkouts (via new --depth option) • Interactive conflict resolution • Changelist support • Relative URLs, peg revisions in svn:externals • Cyrus SASL support for ra_svn and svnserve • ... (more on http://subversion.tigris.org/ svn_1.5_releasenotes.html)
  • 41. Summary • manageable file change history • better collaboration between developers • clearer release management • more than one version of same code base • easier to rollback in case of emergency
  • 42. Recommended Reading Version Control with Subversion, 2nd Edition (O’Reilley Media, Inc) by C. Michael Pilato; Ben Collins-Sussman; Brian W. Fitzpatrick also online: http://svnbook.red-bean.com Managing Software Development with Trac and Subversion (Packt Publishing) by David J Murphy
  • 43. Recommended Reading Subversion Version Control: Using the Subversion Version Control System in Development Projects (Bruce Perens' Open Source Series) by William Nagel
  • 44. Credits Wikipedia Logo http://commons.wikimedia.org/wiki/File:Wikipedia-logo.png
  • 45. Thank you ! Slides on Slideshare http://www.slideshare.net/group/macqel Give feedback on Joind.in http://joind.in/1260