uphpu - streamlined web development - pdf
TRANSCRIPT
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 1/25
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 2/25
Introduction
• Hobbyist since 1997
•
Professional since 2005• Worked w/ LAMP & .NET Solutions
• . .
• Currently Full-Time Contractor & Consultant
• Current Projects:
www.cevo.com www.datingdna.com
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 3/25
Questions for the Audience
• Have an “automated” system in place?
•
Using Source Control (git, svn)?• Using Wiki, Bug Tracker, etc (Trac, MediaWiki)?
•
their Current Setup?
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 4/25
Streamlining Web Development
• Born out of Pure Necessity
•
Time == Money, Do More, Make More• Can Help All Types of Developers
– Sin le Develo ers
– Large Teams
• This is an Overview of Techniques
• Check out my blog for links, in-depth
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 5/25
The Development Cycle
• One Constant in Any Software Development:
– Change!
• Our Goal: Manage Change Efficiently
• What is the Develo ment C cle?
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 6/25
The Development Cycle
Code
Test/QAFeedback
StageDeploy
“Change”
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 7/25
Challenges with Web Development
• Environment (Apache, IIS, Linux, Windows)
•
Dependencies (PHP, Perl, Ruby)• Network (Domain Names, IP Addresses, Etc)
• , ,
• Streamlined Solutions Need to Address These
Challenges
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 8/25
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 9/25
The “Old” Way
• Files on Server & Your Computer
•
Upload via Changes Files (FTP)• No Source Management
•
– 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 - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 10/25
The “Automated” Way
• Goals:
– Least Amount of Human Intervention
– Fast & Quick
– Scripts & Automation Every Step of the Way
– Allow to Quickly Revert
• Rewards:
– Save Time
– Quick “Micro” Changes
– Reduce Errors
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 11/25
Our Tools
• L.A.M.P. – Linux, Apache, MySQL, PHP
•
SVN - Source control• Trac – Wiki, Bug Tracker, Road Map, Timeline
•
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 12/25
Why Use SVN?
• Open Source
•
Source History – Who, What, When, Why• Ensure “Collaboration”
•
• Tip: Everything in SVN
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 13/25
Why Use Trac?
• Opt-In Method
•
Straight Forward, Easy• Powerful Integrated Solution
• ,
• RSS Feeds & Queries
• Who is using? Propel, jQuery, wxWidgets, trac-
hacks, and many more…
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 14/25
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 15/25
Basic Structure – Diagram
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 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 - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 17/25
Using the SVN
• Developers Checkout a Copy
•
Code & Run Environment Locally – XAMPP
– Virtual Machine (Sun’s VirtualBox, Open Source)
• Test Locally
• Commit to SVN Repository
•Meaningful “Commits”
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 18/25
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 19/25
Development Server Troubles
• 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 - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 20/25
Deploying to Staging & Production
• 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 - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 21/25
Deploying to Staging & Production
• Tagging Method
– Pros
• No “Freeze” on Trunk Needed
• Version Numbering
• ear o ers or eac vers on
• More Control Over Tags
• Symbolic Link
– Cons
• Many Tags with Micro Changes
• More Complicated Scripts
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 22/25
Deployment Scripts
• Export vs Update
– Export copies files w/o SVN Info
– Export takes longer, doesn’t “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 - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 23/25
Show Stoppers & Complications
• 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 not Separated
• Shared Hosting , No Shell Access
• Use the System, no half-and-half
• Careful of Revert & Permissions
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 24/25
Other Than Trac
• Redmine
– Ruby / Rails Based
– Multiple Projects Supported
– Gantt Graphs
• SharpForge – C#, .NET Based
• MediaWiki, BugZilla, svnLogBrowser Combo
– More Robust & Powerful
– Not Integrated
8/14/2019 UPHPU - Streamlined Web Development - PDF
http://slidepdf.com/reader/full/uphpu-streamlined-web-development-pdf 25/25
Final Thoughts
• Scales well – (example www.cevo.com)
• Powerful with Apache
– Examples:new_message_system.features.branches.dev.cevo.com
_ _ .re eases. ags. ev.cevo.com
• Multiple Backups
– SVN & Trac easy to Backup
• Any Questions?
• Live Demonstration…