team development best practices for kentico cms brian mckeiver, bizstream, co-owner & kentico...

47
Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Upload: adan-burnett

Post on 02-Apr-2015

226 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Team Development Best Practices for Kentico CMSBrian McKeiver, BizStream, Co-Owner & Kentico MVP

Page 2: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Goals

• Work efficiently as a group• Make your life easier as a Kentico Developer• Hone your craft, make your customers happier

Page 3: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Team

vs.Cowboy Goal 1

Page 4: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Goal 2You don’t have to burn the place down

Page 5: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Goal 3

Gladwell’s 10,000-Hour Rule

Page 6: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Let’s talk about this over a beer

When you see this…

Page 7: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Here We Go: First Time Setup

• Tools of the Trade– Local Workstation– Visual Studio 2010+– SQL Server Management Studio 2008+– Source Control– KenticoCMS_7_0.exe

• Goal: Install Kentico locally

Page 8: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Reasons to Install Locally

• Documentation• API CHM• Kentico Installation Manager (KIM)• Import Toolkit• App Pool Recycles are controlled

Page 9: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Source Control with Kentico

• Code Considerations– One branch or many ?– Depends on team size and goals

• Database Considerations– Leverage built in version control, check-in & check-

out– Why external SQL versioning products may not

work

Page 10: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Running Local Code

• Debug with VS2012

• HTTP Trace via Fiddler

• Your exceptions are yours and yours alone

• No danger of breaking the build

Page 11: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Shared Development Database

• Key idea for Team Development

Kentico CMS SQL DB

Dev 2

Dev 1

Page 12: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Shared Development Instance

• Running full copy of your site in TEST

Dev 2Dev 1

http://localhost:42 http://localhost:42

http://mysite.devserver.com

Shared Dev

Kentico CMS

Page 13: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

QA / Test Server Code

Kentico CMS SQL DB

Dev 2

Dev 1

QA 1 QA / Test can see changes faster

Page 14: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Actual Code Slinging

Page 15: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Grow Your Craft

Jedi Master

Youngling

There is no Try, only Do-Yoda

Page 16: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Naming Standards Matter

• Prefix 3 - 4 characters for project name – Followed by fully spelled out, descriptive name

• Display Names– Upper Case with spaces to delimit words– Prefixing with a special character is recommended because the project

specific or custom object names will roll to the top of the Kentico selectors.

• Object Code Names – No Spaces, no special characters, Upper camel case– 100% Relying on the automatic naming is not recommended

• Use the word “Custom” in Views / Stored Procs– Use System Tables GUI in SiteManager to create them

Page 17: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Making it work: Custom Code Locations

• 2 Strategies– ~/App_Code/<Custom Code> • project code as sub folder

– ~/CMSModules/<Custom Code>– ~/CMSWebParts/<Custom Code>

or– ~/App_Code/_framework/<Custom Code>– ~/_framework/<Custom Code>/CMSModules– ~/_framework/<Custom Code>/CMSWebParts

Page 18: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Making it work: Site Settings

Kentico Site Settings for Team Dev• Check in - check out (Object Lock)• Object Versioning

Blog Post

Page 19: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Object Locking & Versioning

Available for:• CSS Stylesheets• E-mail Templates • Page Layouts• Page Templates• Transformations• Web part

Containers• Web part Layouts

Page 20: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Workflow for Content Tree

Page 21: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Warning 1

“Undo Checkout” is NOT your Friend

Page 22: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Warning 2

You will not be able to see Web Part settings if another developer has a Page Template checked out or if it is checked in.

Page 23: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Tip: See All Checked Out Objects

My Desk tab to the rescue!

Page 24: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Virtual Objects with Kentico

• Check out to File System

• Can still use Kentico UI or External Source Control

• Apply Changes to move back to DB

Page 25: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Virtual Objects: What it does

Use any IDE / Source Control client you want

while editing externally in the file system.

Page 26: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Virtual Objects: How it Saves You

• Kentico Cache and Object Locking– 2 Devs land on the same checked in page template at

same time– One checks out the template, the second goes to get

coffee– One is working, second comes back and checks out– Two checked out copies because working at localhost

Page 27: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Virtual Objects Gotchas

Object Sync Message, respect it.

Page 28: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Deployment Mode with Kentico

When the deployment mode is OFF• location of virtual objects depends on the Source control options.

When the deployment mode is ON • virtual objects are moved from the database to the file system on your

disk. Target folder is ~/CMSVirtualFiles.

Page 29: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Continuous Integration (CI)

Lots of Options:

Jenkins

Team City

Team Foundation Server

Page 30: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Value of CI

Technical Value:• Saves Time• Automatic build and deploy capabilities• Exercise / hone your craftsmanship• Adds responsibility to check ins / commits• Gives you metrics on code base

Page 31: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Value of CI 2

Business Value:• Reduces Risk• Reduces overhead across overall

development process• Provides better Quality Assurance• Raises project visibility

Page 32: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

How to use CI with Kentico

• Automatic polling– Build every X mins

• Hooks– Build when events are triggered– Most common hook is: when a commit occurs

• Most CI systems can spawn a Selenium Test– Automated /Recorded HTTP request

Page 33: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

What to watch out for in upgrade / hotfix

• Files will be overwritten if you do not segment your customizations

Page 34: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Don’t Rely on the System Transforms

• What if someone re-installs a Module ?• POOF• Cloning is your Friend

Page 35: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Deployment Options

Page 36: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Import / Export (multiple)

Page 37: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Import / Export (single)

• Almost every object is export-able

• Look for the small grey dropdown arrow to expand the menu

Page 38: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Import / Export Gotchas

• Update Documents• Linked Documents• License Issues

WTF ?

Page 39: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Content Stage

One click deployment, YES Please! Sign me up.

Page 40: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Content Stage Gotchas

• Stage a task while target server has it checked out **• Javascript Files in Site Manager - don’t go **• Custom Views / Stored Procs - don’t go **• Tasks can get out of control• Large Files

– http://mcbeev.com/...Quick-Tip-Content-Staging-and-Large-Files(yes this is a shameless

plug)– <add key="CMSMediaFileMaxStagingSize" value="1024" />

** Hint Hint Kentico 8 people

Page 41: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Web Farm Sync

• Sync everything everywhere

• Good for initial step in project lifecycle as far as developers go

• Also great for uptime and reliability in Production Environments

Page 42: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Deployment Setting: Macro Security

• A note about Connection Strings and Macro Security• Ever seen this on your page ?• |(user)mcbeev|

(hash)f2c71936597eea6f50f961a7094993459af24e51cf154f75b41032875f810dc0"

• Use the appSetting key:• <add key="CMSHashStringSalt"

value="e68b9ad6-a461-4707-8e3e-ece73f03dd02" />

Page 43: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Team Dev: A Few Other Best Practices

• Keep Zone IDs and Web Part Control IDs as short as possible. Use Web Part Titles instead

• Avoid Ad-hoc Templates, other devs won’t know about them

Page 44: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Working with the Marketing People

• Yes even Content Admins have a right to play in the CMS

• Separate environments for DEV and Content Admins helps

• Use Content Staging to keep in Sync

Page 45: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Wrapping It Up

You’ve Learned• Work efficiently as a group• Make your life easier as a Kentico Developer• Hone your craft, make your customers happier

Team Development is supported better than ever in Kentico 7.0!

Assimilate as a Team. Resistance is Futile.

Team Development FTW.

Page 46: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Questions

Page 47: Team Development Best Practices for Kentico CMS Brian McKeiver, BizStream, Co-Owner & Kentico MVP

Thank You

Email:[email protected]

Web:http://www.bizstream.com

Blog:http://www.mcbeev.com

Twitter:@mcbeev

LinkedIn:http://www.linkedin.com/in/brianmckeiver