opencms days 2012 - how to manage an opencms project using agile and continuous build

35
September 25, 2012

Upload: alkacon-software-gmbh

Post on 18-Nov-2014

1.444 views

Category:

Technology


1 download

DESCRIPTION

Do you want to run a successful OpenCms implementation while maintain flexibility of requirements throughout the project? Deliver high quality implementations; reduce bugs, QA cycles and deliver high quality on time projects? Richard will discuss the ins and outs of Agile development as it pertains to an OpenCms project as well as how to build and develop deploy scripts and continuous builds to keep multiple teams working in parallel on a project.

TRANSCRIPT

Page 1: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

September 25, 2012

Page 2: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

INTRODUCTION

About me and NorthPoint…

+ NorthPoint is a USA-based organization with offices in New

York and Boston

+ Specializing in Open Source technologies for web applications

+ 130+ on-staff technologists focusing on Digital Strategy,

Content Management and Enterprise Digital Architectures

+ Areas of focus in Media, Publishing, Finance, Healthcare,

Education, and Not-for-Profit markets

Page 3: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

WHAT WE WILL DISCUSS TODAY

Running a successful OpenCms project leveraging Agile

Maintain flexibility of requirements

Deliver high-quality OpenCms implementations through use

of TDD & Continuous Build

Agile Development

Overview

How we run Agile with OpenCms

Development of Deploy Scripts and Continuous Build

Page 4: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

RUNNING A SUCCESSFUL

OPENCMS PROJECT

LEVERAGING AGILE

Agile Development Process

Why use Agile?

Everyone has their own take on Agile – “Part of the Issues”

Review of “True Agile” development

Tying in Agile with Extreme Programming Techniques

Agile approach for OpenCms projects

Page 5: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

WHY CHANGE? WHY AGILE?

Why should we change from traditional project management and development methods?

The traditional method breaks down during the lifecycle of the project

Change Request

Changes in business

The applications winds up being different from what was originally documented and envisioned

Feedback from the customer is at the end of the process

Page 6: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

TRADITIONAL SOFTWARE

DEVELOPMENT

Business Analysis and Systems Analysis and the Design has been signed off by the customer

Development begins Change Requests begin

More functionality changes and tweaks later and things are not looking good

The schedule begins lagging

Client’s first BETA and even more changes are requested

Chances are, it's a mess of coding and comments without proper notes and testing and by now every little change here breaks something there

Page 7: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

CURRENT APPROACH –

WHY IT FAILS?

The Methodology didn’t

work The Solution didn’t

work

Page 8: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

TRADITIONAL FEATURE &

FUNCTION USAGE

Page 9: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

WHAT CAN WE DO?

New techniques are being used to break this familiar

mold of software development

They are known as Extreme and/or Agile development

Developing OpenCms custom modules with Agile is the

way to go

Page 10: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

AGILE – A QUICK OVERVIEW

Scrum – an iterative, incremental process

All work is done in Sprints

Sprints last for 30 days

Every day the team gets together for a daily Scrum that

lasts 15 minutes

Incremental, potentially shippable product functionality

every 30 days

Page 11: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

HOW IT WORKS WITH OPENCMS

Although following Agile to the letter sounds good, in

practice we have made some slight variations

Upfront Analysis and Definition of Scope

Source Control, Continuous Build and Continuous

Integration

Full QA at the end

Planning ahead for next phases

Page 12: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

TEAMS AND CODE MANAGEMENT

Creating Epics, Stories and Tasks

Using the Stories to create test cases – the beginning of

TDD

Leveraging JUnit for custom code

We use Jira to help run things

Multiple teams need a good solution

Continuous is the only way

Page 13: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

TEAMS AND CODE MANAGEMENT

The tools we use

Jira – Greenhopper, Crucible, Fisheye and Hudson along with custom Scripts

Greenhopper – used for bringing things together

Estimating, Velocity, Burn downs, etc.

Crucible is a web-based tool that we use for in-line commenting, code reviews (allows for collaboration between author and reviewer)

We feel this is a better approach than paired programming

Fisheye for continuous build along with Hudson. Fisheye helps when trying to connect SVN commits through hooks in the code review process leveraging Crucible and Fisheye, in conjunction with automated quality test through sonar

Page 14: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

ISSUES WITH AUTOMATION

AND OPENCMS

The issues with integrated testing and automated builds with OpenCms is the way things work in OpenCms

Much of the code is in context sensitive situations where part of the code is in Java, part in JSP’s and the rest in OpenCms core

To create an automated process you need to be able to test across these different types of code

What we created is a combined integration and test server where code is automatically compiled and deployed

Once it’s deployed, tests can be triggered against the code through Selenium scripts for front-end testing

Page 15: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

MAKE IT WORK

Commitment to change

Leveraging Test Driven Development (TDD)

adding a test, then making it work

Develop the backlog

Creating the right team mix

Page 16: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

WHAT’S NEEDED WITH OPENCMS

Maintain a Code Repository

SVN, Github

Automate the Build Process

Maven

Make the build Self Testing

Test Driven Development (JUnit for Java Classes)

JSP’s require a different approach

Automate Scheduling and Deployment

Hudson

Page 17: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

Modules and source code are deployed to the VFS

VFS is located in the Database

Modules need to be packaged (zipped) into OpenCms module

format in order to be imported

What about importing non module code into the VFS system

folder?

What if we did not want to import an entire module but only

parts of it?

CONTINUOUS BUILD PROBLEMS

Page 18: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

OUR ANSWER

Create Scripts

Create a script that packages source code into

OpenCms-ready module

Create a script which will prepare source code to be

synchronized in OpenCms using the workplace

synchronization tool

Page 19: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

Sync System and

Make Modules Scripts

Two shell scripts which prepare

source code to be imported and

synchronized with OpenCms

Page 20: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

NEED TO SET

ENVIRONMENT VARIABLES

+ export TOMCAT_HOME=/usr/local/tomcat

+ Location of app server where OpenCms is running + export DIR_SVN=/usr/local/src/svn/trunk/opencms

+ Location of your subversion directory and src code

+ export OPENCMS_HOME=/usr/local/tomcat/webapps/opencms + Location of the OpenCms deployed web site running inside of AppServer

+ export SYNC_DIR=/usr/local/src/opencms/sync + Directory which will be used to sync content between the file system and OpenCms

Virtual File System (VFS)

Environment variables need to be set in order to execute the shell

scripts. Scripts will use the environment variables making it easier to move scripts in between different environments with little effort

*Environment variables can commonly be set in a users .bash_profile file

Page 21: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

WHERE ARE SCRIPTS?

Scripts live in the bin directory in your source code home

directory (DIR_SVN)

Module source code lives in the modules_src directory

Subversion Home Directory

Page 22: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

MakeModule.sh

This script will take source code from

Subversion repository and zip up the code

and deploy it to the OpenCms server. User

will then be able to login to the admin and

upload the module via the module

manager.

Page 23: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

MakeModule.sh

+ Executing the Script

+ Pass in the environment (dev)

+ Used if there are multiple instances (dev, test

prod) of OpenCms running on one machine

+ Pass in the module name

(edu.chop.migration)

Page 24: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

MAKE Module.sh RESULTS

+ Module code copied from the modules_src directory

and zipped up and ready for deployment

+ Module code copied and deployed to the OpenCms

package directory

/WEB-INF/packages/modules/

Page 25: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

MakeModule.sh LAST STEP

Log into OpenCms admin and deploy the module

Page 26: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

syncSystme.sh SECOND SCRIPT

This script will sync source code to OpenCms by

copying code to a sync directory (SYNC_DIR) and

then using OpenCms to import the files from that

directory using the OpenCms synchronization tool

Page 27: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

syncSystem.sh

Step 1

– Configure synchronization settings in OpenCms

+ Synchronization setting will need to be configured to point to your file system

sync directory. Also we need to specify which folders in the VFS we want to

sync

Page 28: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

syncSystem.sh

Step 2

+ Sync Down

+ Before we sync files from the file system into the VFS

we first take files out of the VFS and put them on the

file system

+ We want to tell the script which folders we want to

sync

+ Gives the sync folder an up-to-date snapshot of

the current source code in the VFS

+ Synchronizing will overwrite files and does not

create new ones

Page 29: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

syncSystem.sh Step 2 cont...

– Click on the sync button on the top right of screen

Page 30: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

Step 3 Run Sync Module Script

Go to your Subversion home directory

Run the script

syncSystem.sh

Page 31: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

Sync Folder updated

synsSystem.sh RESULTS

Page 32: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

Step 4 Sync Up

- Running the synchronization again will push

the files from the file system up to the VFS

synsSystem.sh

Page 33: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

syncSystem.sh

Sync is complete!

Page 34: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

RECAP OF AN OPENCMS PROJECT

USING AGILE AND CONTINUOUS

BUILD

Agile process for better management of requirements

and working with the end user

Jira and third-party tools for:

Managing Code

Automated Testing

Keeping Multiple Teams in Sync

Custom Scripts for Continuous Build

Supported by tools such as Hudson and possibly Gradle in

the future

Page 35: OpenCms Days 2012 - How to manage an OpenCms project using Agile and continuous build

RICH COOLEY

[email protected]

TALK TO US. CHALLENGE US.

CALL US at 212.819.1700

VISIT US at www.northps.com

FOLLOW US @northps

© NorthPoint and NorthPoint Solutions LLC