Create your own polished presentation in minutes. Just describe what you need.
Free to try, no credit card requiredSugarCon 2010
The 2010 SugarCRM Customer & Developer Conference
Case Study: Managing Sugar Extensions
in a Multi-Developer Environment
Chad Hutchins
3:10 pm – 3:50 pm
Wednesday, April 14th
Napa Room
Business Development Web Specialist
Milsoft Utility Solutions, Inc.
About Chad, SugarCon and Milsoft
About Me, SugarCon and Milsoft
Chad Hutchins
hutchins.chad@gmail.com
@chadhutchins
Self-hosted SugarCRM Instance
Business Development Web Specialist
SugarCRM Professional
~100 SugarCRM Users
Entrepreneur
The Problem and Solution
The Problem and Solution
So... What's the Solution
Problems
Unmanageable Number of Customizations
Difficulties Upgrading and Patching
a Version Control System (VCS)
No Easy Way to Test Customizations
a VCS is a simple way to manage
different versions of code in
multi-developer environments
Multi-Developer Environment
Subversion
Git
and about 100 others...
Git, a version control system
Git, a version control system
Git Command Reference
Installing Git
Git Basics
init - creates a new repository
git server
or github
codebase
http://git-scm.com/download
Client
add - add additional files to repository
commit - submit changes to repository
initial git
repository
Server
http://bit.ly/ug0T
branch - creates a new working branch
developer
merge - combine two branches into one
application
users
application
server
User Authentication
checkout - switches between working branches
SSL
clone - downloads an entire repository from host
pull - downloads particular branch from repository host
other developers
push - submits repository to the repository host
gitk - a tool for visualizing a repository
Recipes for using
Git and SugarCRM
Recipes for using Git and SugarCRM
Setup a SugarCRM Git Repository (one-time process)
Setting up a Development (testing) Environment
Setting up the Live Server Environment
This is a one-time process.
codebase
1
put a copy of your current SugarCRM codebase on the server you want to host the repo on
git server
or github
1
git server
or github
1
at the command prompt or in terminal, navigate to the
parent directory where you will be serving SugarCRM
in your testing environment
at the command prompt or in terminal, navigate to the
parent directory where you will be serving SugarCRM
initial git
repository
2
in terminal or at a command prompt
navigate into the codebase's folder
initial git
repository
git server
or github
developer
2
3
get a copy of the codebase from the git server
using the following command:
run the following commands to initialize the
codebase into the repository
2
get a copy of the codebase from the git server
using the following command:
initial git
repository
git init
git clone git://username@path/to/location.git SuagrCRM
git clone git://username@path/to/location.git SuagrCRM
git add .
application
server
git commit -m "Initial Codebase Import"
application
server
3
rename config.php.ini to config.php
rename .htaccess.ini to .htaccess
4
tell git to ignore certain files.
in your git repo folder, navigate to the
.git/info/ folder and open the "exclude" file.
3
rename config.php.ini to config.php
rename .htaccess.ini to .htaccess
application
users
4
login to SugarCRM
repair & rebuild all modules
we want to exclude the following:
4
application
users
login to SugarCRM
repair & rebuild all modules
add the following lines to the exclude file:
cache/*
custom/modules/*/Ext
config.php
config_override.php
sugarcrm.log
.htaccess
5
duplicate config.php and rename config.php.ini
duplicate .htaccess and rename .htaccess.ini
then run the following commands:
git add .htaccess.ini config.php.ini
git commit -m "Custom Setup Preparation"
Upgrading / Patching
Building a New Feature
Follows the same process as the "Building a New Feature" section
1
in a developer's testing environment, navigate to the
SugarCRM repository directory with the command
prompt or terminal
developer
1
In a development environment, create a new "upgrade" branch
from the "master" branch
create a new branch that describes the new feature
2
git branch my-new-feature
5
once the new feature is completed and ready to
be implemented on the live server, switch back to
the master branch
git checkout my-new-branch
Run the upgrade or patch install on the "upgrade" branch
2
git checkout master
make all the necessary code modifications to get
the new feature running in the local environment
merge the master branch with the my-new-feature branch
6
git merge my-new-feature
3
3
register and submit the changes in
the code to the repository
Once it's thoroughly tested: commit, merge (with the "master" branch)
and push the "upgrade" branch to the git server
git server
or github
git add .
git commit -m "Added a new feature."
push your local merging changes to the git server
7
git push origin master
initial git
repository
4
On the live server, pull the latest code from the master branch
that is on the git server
4
push the my-new-feature branch to the git
server so that other developers can help develop
the new feature and so it is backed-up somewhere
other than your local machine
now that the new feature is in the master branch
of the codebase, we need to update the live server's
codebase with the latest code in the master branch
git push origin my-new-feature
repeat steps 3 and 4 until you are ready to move
the new feature into production on the live server
8
in the command prompt or terminal of the live server,
navigate to the SugarCRM directory and pull the latest code
git pull origin master
application
server
Final Thoughts
Closing
Issues
Thoughts
is all the extra work worth it?
database versioning
get familiar with git
hosting git
reverting & undoing mistakes
http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way
Undo the last commit
git revert HEAD
Undo any changes since the last commit
git reset --hard
using Studio, Module Builder, Drop Down Editor, etc.
think of the live instance of SugarCRM as if it were a developer
Thank you!
Questions?
Chad Hutchins
hutchins.chad@gmail.com
@chadhutchins
;-)
Create your own polished presentation in minutes. Just describe what you need.
Free to try, no credit card required