SlideShare a Scribd company logo
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
Kyle Bowerman
Appirio / Cloudspokes TA
@kylebowerman
Just four commands can change you life!

ant
git
git
git

fetchmyorg
add .
commit –a –m ’auto commit’
push origin
Topics we will cover today
▪ANT (Force.com migration tool)

▪GIT

• Basic deploy
• Basic Fetch

• Git Concepts
• Bug fix example

▪ Defensive SCM strategy
• Monitor changes daily
• Forensics tool

▪ Offensive SCM strategy
• Release packages
• Directory structures
• Cloud repositories and Tools
Ant for retrieve,

still just three files (defensive)

build.properties = login, password and serverurl
build.xml = what to do
Unpackge-all.xml = what to get (supports * wildcards)

Ant fetchdev3
Ant for deployment,

same three files (offensive)

build.properties = login, password and serverurl
package.xml = the manifest (what to deploy)
build.xml = the instructions of what to do <target>
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
Git concepts and commands
clone
remote
branch
fetch
pull
push

checkout
merge
add
commit
log
tag

pull:
brings down
push:
latest src

repo

fetch:
brings down
latest src
from repo to
HEAD

puts latest
and merges
commit into
it into current
repo
branch

branch:

Local

copies the master branch

clone: gets the code from
the remote, do once
Daily snapshots: defensive example
ant
git
git
git

fetchmyorg
add .
commit –a –m ’auto commit’
push origin
Classic bug fix: offensive example
git clone http://github/user/reponame
git checkout –b issue49
change code and test
git commit –a –m ‘fixed issue #49’
git checkout master
git merge issue49
git push origin
What you git
What you git
detail of a commit

• link to issue (github)
• commit message
• author and date
• summary of change
• diff of each change
• detail of each file
Two options for directory structures for salesforce.
com orgs
Use 1 branch per org
▪ SRC

Use a sub dir per org
▪ Orgs

▪ packages

• Prod/SRC

▪ docs

• Dev/SRC

▪ data
▪ scripts
▪ readme.md
▪ build.xml
▪ unpackage-all.xml

• Testing/SRC

▪ docs
▪ packages
▪ data
▪ readme.md
▪ build.xml
Options for version numbering your release
Major.Minor.release#
Project.Feature.Sprint#.Hotfix#
Project.ApiVersion.model.release#

1.2.31
1.0.6.1
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.
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
Git GUIs:
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
Kyle Bowerman
Technical Architect
@kylebowerman
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
Manage Org Changes Using the Force.com Migration Tool and Git

More Related Content

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

  • 1. 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
  • 2. Kyle Bowerman Appirio / Cloudspokes TA @kylebowerman
  • 3. Just four commands can change you life! ant git git git fetchmyorg add . commit –a –m ’auto commit’ push origin
  • 4. Topics we will cover today ▪ANT (Force.com migration tool) ▪GIT • Basic deploy • Basic Fetch • Git Concepts • Bug fix example ▪ Defensive SCM strategy • Monitor changes daily • Forensics tool ▪ Offensive SCM strategy • Release packages • Directory structures • Cloud repositories and Tools
  • 5. Ant for retrieve, still just three files (defensive) build.properties = login, password and serverurl build.xml = what to do Unpackge-all.xml = what to get (supports * wildcards) Ant fetchdev3
  • 6. Ant for deployment, same three files (offensive) build.properties = login, password and serverurl package.xml = the manifest (what to deploy) build.xml = the instructions of what to do <target>
  • 7. 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
  • 8. Git concepts and commands clone remote branch fetch pull push checkout merge add commit log tag pull: brings down push: latest src repo fetch: brings down latest src from repo to HEAD puts latest and merges commit into it into current repo branch branch: Local copies the master branch clone: gets the code from the remote, do once
  • 9. Daily snapshots: defensive example ant git git git fetchmyorg add . commit –a –m ’auto commit’ push origin
  • 10. Classic bug fix: offensive example git clone http://github/user/reponame git checkout –b issue49 change code and test git commit –a –m ‘fixed issue #49’ git checkout master git merge issue49 git push origin
  • 12. What you git detail of a commit • link to issue (github) • commit message • author and date • summary of change • diff of each change • detail of each file
  • 13. Two options for directory structures for salesforce. com orgs Use 1 branch per org ▪ SRC Use a sub dir per org ▪ Orgs ▪ packages • Prod/SRC ▪ docs • Dev/SRC ▪ data ▪ scripts ▪ readme.md ▪ build.xml ▪ unpackage-all.xml • Testing/SRC ▪ docs ▪ packages ▪ data ▪ readme.md ▪ build.xml
  • 14. Options for version numbering your release Major.Minor.release# Project.Feature.Sprint#.Hotfix# Project.ApiVersion.model.release# 1.2.31 1.0.6.1 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.
  • 15. 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
  • 17. 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
  • 19. 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