uphpu - streamlined web development

Upload: justin-carmony

Post on 30-May-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 UPHPU - Streamlined Web Development

    1/25

  • 8/14/2019 UPHPU - Streamlined Web Development

    2/25

    Introduction

    Hobbyist since 1997 Professional since 2005

    Worked w/ LAMP & .NET Solutions

    Blog:http://www.justincarmony.com/blog/

    Currently Full-Time Contractor &

    Consultant Current Projects:

    www.cevo.com www.

    datingdna.co

  • 8/14/2019 UPHPU - Streamlined Web Development

    3/25

    Questions for the Audience

    Have an automated system inplace?

    Using Source Control (git, svn)?

    Using Wiki, Bug Tracker, etc (Trac,MediaWiki)?

    Who Thinks There is Room for

    Improvement in their Current Setup?

  • 8/14/2019 UPHPU - Streamlined Web Development

    4/25

    Streamlining Web

    Born out of Pure Necessity Time == Money, Do More, Make More

    Can Help All Types of Developers

    Single Developers Large Teams

    This is an Overview of Techniques

    Check out my blog for links, in-depth

  • 8/14/2019 UPHPU - Streamlined Web Development

    5/25

    The Development Cycle

    One Constant in Any SoftwareDevelopment: Change!

    Our Goal: Manage Change Efficiently What is the Development Cycle?

  • 8/14/2019 UPHPU - Streamlined Web Development

    6/25

    The Development Cycle

    Chang

  • 8/14/2019 UPHPU - Streamlined Web Development

    7/25

    Challenges with Web

    Environment (Apache, IIS, Linux,Windows)

    Dependencies (PHP, Perl, Ruby)

    Network (Domain Names, IPAddresses, Etc)

    Configuration (Cache, Database, etc)

    Streamlined Solutions Need toAddress These Challenges

  • 8/14/2019 UPHPU - Streamlined Web Development

    8/25

    The Old Way

  • 8/14/2019 UPHPU - Streamlined Web Development

    9/25

    The Old Way

    Files on Server & Your Computer Upload via Changes Files (FTP)

    No Source Management

    Problems? Overwriting Files

    Manual Management

    Which Files Changed? Upload All? Who changed what? When?

    Prone to Errors, Bugs == Wasted Time

  • 8/14/2019 UPHPU - Streamlined Web Development

    10/25

    The Automated Way

    Goals: Least Amount of Human Intervention

    Fast & Quick

    Scripts & Automation Every Step of theWay

    Allow to Quickly Revert

    Rewards: Save Time

    Quick Micro Changes

    Reduce Errors

  • 8/14/2019 UPHPU - Streamlined Web Development

    11/25

    Our Tools

    L.A.M.P. Linux, Apache, MySQL, PHP SVN - Source control

    Trac Wiki, Bug Tracker, Road Map,

    Timeline Shell Scripts

  • 8/14/2019 UPHPU - Streamlined Web Development

    12/25

    Why Use SVN?

    Open Source Source History Who, What, When,

    Why

    Ensure Collaboration Built for the Development Cycle

    Tip: Everything in SVN

  • 8/14/2019 UPHPU - Streamlined Web Development

    13/25

    Why Use Trac?

    Opt-In Method Straight Forward, Easy

    Powerful Integrated Solution

    Plugins, Customizabled RSS Feeds & Queries

    Who is using? Propel, jQuery,

    wxWidgets, trac-hacks, and manymore

  • 8/14/2019 UPHPU - Streamlined Web Development

    14/25

    Basic Structure

    SVN Repository Trac

    Dev & Staging Servers

    Production Server

  • 8/14/2019 UPHPU - Streamlined Web Development

    15/25

    Basic Structure Diagram

  • 8/14/2019 UPHPU - Streamlined Web Development

    16/25

    Setting Up the SVN

    Use Standard Structure /trunk , /branches , /tags , /resources

    Other Possible folders:

    /production

    /documentation

    Apache mod_svn to host repository

    Security using basic .htpasswd

  • 8/14/2019 UPHPU - Streamlined Web Development

    17/25

    Using the SVN

    Developers Checkout a Copy Code & Run Environment Locally

    XAMPP

    Virtual Machine (Suns VirtualBox, OpenSource)

    Test Locally

    Commit to SVN Repository Meaningful Commits

  • 8/14/2019 UPHPU - Streamlined Web Development

    18/25

    Development Server

    Setup Apache for a website Checkout a copy of /trunk for the

    httpdocs

    Create post-commit svn hook Hook executes an svn update to

    httpdocs

    Other Types of Hooks: start-commit check permissions

    pre-commit validate code (i.e. syntaxerrors)

  • 8/14/2019 UPHPU - Streamlined Web Development

    19/25

    Development Server

    Apache needs access to: R+W Httpdocs folder

    R+W SVN Repo

    Execute SVN Hooks Development Server NOT PUBLIC!

  • 8/14/2019 UPHPU - Streamlined Web Development

    20/25

    Deploying to Staging &

    Use exact same methods for both Staging is for testing the whole

    picture.

    Production Folder Method Pros

    Scripts More Simple

    Diff on production folder

    Less tags with micro changes

    Cons

    Merging can be a hassle

    Require Freeze on Trunk

  • 8/14/2019 UPHPU - Streamlined Web Development

    21/25

    Deploying to Staging &

    Tagging Method Pros

    No Freeze on Trunk Needed

    Version Numbering

    Clear folders for each version

    More Control Over Tags

    Symbolic Link

    Cons Many Tags with Micro Changes

    More Complicated Scripts

  • 8/14/2019 UPHPU - Streamlined Web Development

    22/25

    Deployment Scripts

    Export vs Update Export copies files w/o SVN Info

    Export takes longer, doesnt delete files

    Export is more robust, less likely to break Update can fail if conflicts occur on files

    Update for New, Export for Existing

    Set Permissions Test Scripts Check Web Services,

    Website, etc.

  • 8/14/2019 UPHPU - Streamlined Web Development

    23/25

    Show Stoppers &

    Website is hard coded for a domain: www.example.com, dev.example.com,

    stage.example.com, local.example.com

    No Configuration files for DB, email,cache, environment, paths, etc.

    User & Uploaded Content notSeparated

    Shared Hosting , No Shell Access

    Use the System, no half-and-half

    Careful of Revert & Permissions

  • 8/14/2019 UPHPU - Streamlined Web Development

    24/25

    Other Than Trac

    Redmine Ruby / Rails Based

    Multiple Projects Supported

    Gantt Graphs SharpForge

    C#, .NET Based

    MediaWiki, BugZilla, svnLogBrowserCombo More Robust & Powerful

    Not Integrated

  • 8/14/2019 UPHPU - Streamlined Web Development

    25/25

    Final Thoughts

    Scales well (examplewww.cevo.com)

    Powerful with Apache

    Examples:new_message_system.features.branches.dev.cevo.com3_2_24.releases.tags.dev.cevo.com

    Multiple Backups SVN & Trac easy to Backup

    Any Questions?

    Live Demonstration