manage org changes using the force.com migration tool and git

20
The Force.com Migration tool, GIT and You ANT and GIT: an offensive and defensive strategy for Source Control Management Kyle Bowerman, Appirio/Cloudspokes, Technical Architect @kylebowerman

Upload: salesforce-developers

Post on 10-May-2015

549 views

Category:

Technology


3 download

DESCRIPTION

Join us to learn how the Force.com Migration Tool is a powerful instrument for deploying code and configuring salesfoce.com. The Ant-based tool offers the ability to take a snapshot of your code and configuration, which you can then store in any source code management system such as Git. These snapshots can be used to restore, in part or in whole, your org to a previous state. In addition to recovery, if we stack these snapshots we can use them for forensic purposes to find when a Salesforce environment changed.

TRANSCRIPT

Page 1: Manage Org Changes Using the Force.com Migration Tool and Git

The Force.com Migration tool, GIT and YouANT and GIT: an offensive and defensive strategy for Source Control ManagementKyle Bowerman, Appirio/Cloudspokes, Technical Architect@kylebowerman

Page 2: Manage Org Changes Using the Force.com Migration Tool and Git

Kyle BowermanAppirio / Cloudspokes TA@kylebowerman

Page 3: Manage Org Changes Using the Force.com Migration Tool and Git

Just four commands can change you life!

ant fetchmyorggit add .git commit –a –m ’auto commit’git push origin

Page 4: Manage Org Changes Using the Force.com Migration Tool and Git

Topics we will cover today

▪ Defensive SCM strategy• Monitor changes daily• Forensics tool

▪ Offensive SCM strategy • Release packages• Directory structures• Cloud repositories and Tools

▪GIT• Git Concepts• Bug fix example

▪ANT (Force.com migration tool)• Basic deploy• Basic Fetch

Page 5: Manage Org Changes Using the Force.com Migration Tool and Git

Ant for retrieve, still just three files (defensive)build.properties = login, password and serverurlbuild.xml = what to doUnpackge-all.xml = what to get (supports * wildcards)

Ant fetchdev3

Page 6: Manage Org Changes Using the Force.com Migration Tool and Git

Ant for deployment, same three files (offensive)build.properties = login, password and serverurlpackage.xml = the manifest (what to deploy)build.xml = the instructions of what to do <target>

Page 7: Manage Org Changes Using the Force.com Migration Tool and Git

What is GIT and why use it

▪ 3rd Generation▪ Ubiquitous standard▪ Highly distributed and easy▪ Easy to branch, merge and audit▪ Cloud repos offer additional services like issue tracking and wiki

git clone https://github.com/forcedotcom/aura.git

Page 8: Manage Org Changes Using the Force.com Migration Tool and Git

Git concepts and commands

cloneremotebranchfetchpullpush

checkoutmerge addcommitlogtag

clone: gets the code from the remote, do once

repo

Localbranch: copies the master branch

fetch: brings down latest src from repo to HEAD

pull: brings down latest src and merges it into current branch

push: puts latest commit into repo

Page 9: Manage Org Changes Using the Force.com Migration Tool and Git

Daily snapshots: defensive example

ant fetchmyorg git add . git commit –a –m ’auto commit’ git push origin

Page 10: Manage Org Changes Using the Force.com Migration Tool and Git

Classic bug fix: offensive example

git clone http://github/user/reponamegit checkout –b issue49 change code and testgit commit –a –m ‘fixed issue #49’git checkout mastergit merge issue49git push origin

Page 11: Manage Org Changes Using the Force.com Migration Tool and Git

What you git

Page 12: Manage Org Changes Using the Force.com Migration Tool and Git

What you gitdetail of a commit

• link to issue (github) • commit message• author and date• summary of change• diff of each change• detail of each file

Page 13: Manage Org Changes Using the Force.com Migration Tool and Git

Two options for directory structures for salesforce.com orgs

Use 1 branch per org▪ SRC▪ packages▪ docs▪ data▪ scripts▪ readme.md▪ build.xml▪ unpackage-all.xml

Use a sub dir per org▪ Orgs

• Prod/SRC• Dev/SRC• Testing/SRC

▪ docs▪ packages▪ data▪ readme.md▪ build.xml

Page 14: Manage Org Changes Using the Force.com Migration Tool and Git

Options for version numbering your release

Major.Minor.release# 1.2.31Project.Feature.Sprint#.Hotfix# 1.0.6.1Project.ApiVersion.model.release# 2.29.14.27

You can use any versioning schema you want or create you own. The important thing is that everyone understands what each digit means, and you have a release note for each release.

Page 15: Manage Org Changes Using the Force.com Migration Tool and Git

Git Cloud Repositories▪ Github

• No free repos• Industry standard for open source• Wiki and Issue tracker• Smart Commits

▪ Bitbucket• Unlimited private repos (but only 5 users)• From Atlassian• Side by side diffs

Page 16: Manage Org Changes Using the Force.com Migration Tool and Git

Git GUIs:

Page 17: Manage Org Changes Using the Force.com Migration Tool and Git

All About Appirio and Cloudspokes

Appirio is a global service company that uses traditional consulting, crowd sourcing and cloud, social and mobile technology to help enterprises dramatically improve the way they do business.

Cloudspokes is Appirio’s crowd sourcing business unit. With it’s recent acquisition of TopCoder.com, it provides a resource of nearly 600k developers world wide to provide customer solutions

Page 18: Manage Org Changes Using the Force.com Migration Tool and Git

Kyle Bowerman

Technical Architect@kylebowerman

Page 19: Manage Org Changes Using the Force.com Migration Tool and Git

We want to hear from YOU!

Please take a moment to complete our session survey

Surveys can be found in the “My Agenda” portion of the Dreamforce app

Page 20: Manage Org Changes Using the Force.com Migration Tool and Git