Dreamforce14 Metadata Management with Git Version Control

45
Managing changes in your Salesforce Org with Git agileforce.c o.uk John Stevenso @jr0cket

description

An introduction to using Git version control to manage changes in the metadata of your Salesforce Org as you develop your apps. Your app is put into an unmanaged package, copied to your local machine with Force.com CLI and changes pushed to Github using Github for Mac/Windows client.

Transcript of Dreamforce14 Metadata Management with Git Version Control

Page 1: Dreamforce14 Metadata Management with Git Version Control

Managing changes in your Salesforce Org with Git

agileforce.co.uk

John Stevenson

@jr0cket

Page 2: Dreamforce14 Metadata Management with Git Version Control

Safe Harbor

Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.

The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, risks associated with possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal quarter ended July 31, 2011. This document and others are available on the SEC Filings section of the Investor Information section of our Web site.

Any unreleased services or features referenced in this or other press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.

Page 3: Dreamforce14 Metadata Management with Git Version Control

Why manager changes in your Salesforce Org?

John Stevenson

@jr0cket

agileforce.co.uk

Page 4: Dreamforce14 Metadata Management with Git Version Control

Keeping a record of change

Understand:

•what has been built•when something has been added or changed•who added that feature / bug

Page 5: Dreamforce14 Metadata Management with Git Version Control

So, what is Git ?

John Stevenson

@jr0cket

agileforce.co.uk

Page 6: Dreamforce14 Metadata Management with Git Version Control

Say goodbye to Centralised version control

No more merge days (weeks)

No longer tied to the network

No more waiting for the server to respond

Page 7: Dreamforce14 Metadata Management with Git Version Control

So what is Git

A distributed version control system

Based on “change sets”, rather than files

Easy to merge changes between branches & repositories

WorkingCopy

StagingLocal

RepositoryGithub

Repository

Page 8: Dreamforce14 Metadata Management with Git Version Control

How do you use Git

GithubRepository

Page 9: Dreamforce14 Metadata Management with Git Version Control

Getting Started with Git

Git client- windows.github.com- mac.github.com- git-scm.com

Identify yourself to Git

git config --global user.name=“John Stevenson” git config --global user.email=“[email protected]

Page 10: Dreamforce14 Metadata Management with Git Version Control

Github for Mac / Windows – Simple start point

Page 11: Dreamforce14 Metadata Management with Git Version Control
Page 12: Dreamforce14 Metadata Management with Git Version Control
Page 13: Dreamforce14 Metadata Management with Git Version Control
Page 14: Dreamforce14 Metadata Management with Git Version Control

So, what is Github ?

John Stevenson

@jr0cket

agileforce.co.uk

Page 15: Dreamforce14 Metadata Management with Git Version Control

“Social Coding” with Github

Create repositories on Github and share your code with the world

Features:

Forking – create your own copy of a repository on Github

Pull Requests – ask that your change be reviewed and added to someone else’s repository

Page 16: Dreamforce14 Metadata Management with Git Version Control

Getting Started with Github

Github account from github.com

Optionally: - Add a Public key to your account - Add 2-factor authentication to your account

Page 17: Dreamforce14 Metadata Management with Git Version Control
Page 18: Dreamforce14 Metadata Management with Git Version Control

Lets use Git & Github to manage our Salesforce Org

John Stevenson

@jr0cket

agileforce.co.uk

Page 19: Dreamforce14 Metadata Management with Git Version Control

Create a repository on Github

Page 20: Dreamforce14 Metadata Management with Git Version Control

Screenshots from blog post

Page 21: Dreamforce14 Metadata Management with Git Version Control

1. Add repository

1. Select “Clone”

1. Type name of repository to clone

1. Clone repository to your computer

Page 22: Dreamforce14 Metadata Management with Git Version Control
Page 23: Dreamforce14 Metadata Management with Git Version Control

Show me the Metadata

John Stevenson

@jr0cket

agileforce.co.uk

Page 24: Dreamforce14 Metadata Management with Git Version Control

developer.salesforce.com/page/Force.com_IDE

Force.com IDE

- Apex- Visualforce

pages- Unit Tests- Git

Page 25: Dreamforce14 Metadata Management with Git Version Control

MavensMate.comSublime Text plugin for Force.com

- Apex- Visualforce - Unit Tests- Git

- Lightweight- Templates

Page 26: Dreamforce14 Metadata Management with Git Version Control

Force.com Command Line Interface(CLI)

force-cli.heroku.com

Page 27: Dreamforce14 Metadata Management with Git Version Control

Packaging up the Gardening App

John Stevenson

@jr0cket

agileforce.co.uk

Page 28: Dreamforce14 Metadata Management with Git Version Control

The Gardening App

I created a Salesforce App called Gardening

Page 29: Dreamforce14 Metadata Management with Git Version Control

Create a new package

I just want to version my Gardening App

Page 30: Dreamforce14 Metadata Management with Git Version Control

Creating an unmanaged package

Page 31: Dreamforce14 Metadata Management with Git Version Control

The Gardening App to the package

Page 32: Dreamforce14 Metadata Management with Git Version Control

The Gardening App is now packaged

Page 33: Dreamforce14 Metadata Management with Git Version Control

Using Force CLI to get your Metadata

John Stevenson

@jr0cket

agileforce.co.uk

Page 34: Dreamforce14 Metadata Management with Git Version Control

So what is Git

force-cli.herokuapp.com

Page 35: Dreamforce14 Metadata Management with Git Version Control

Connect Force CLI to your Salesforce Org

Using OAuth secure connection

force login

Page 36: Dreamforce14 Metadata Management with Git Version Control

Connect Force CLI to your Salesforce Org

From the directory created by the Github client

force fetch package DreamforceHack --unpack

Page 37: Dreamforce14 Metadata Management with Git Version Control

Versioning your Metadata

John Stevenson

@jr0cket

agileforce.co.uk

Page 38: Dreamforce14 Metadata Management with Git Version Control

Github Client picks up changes automatically

Page 39: Dreamforce14 Metadata Management with Git Version Control

Github Client picks up changes automatically

Page 40: Dreamforce14 Metadata Management with Git Version Control

Github Client picks up changes automatically

Page 41: Dreamforce14 Metadata Management with Git Version Control

Github Client picks up changes automatically

Page 42: Dreamforce14 Metadata Management with Git Version Control

Github Client picks up changes automatically

Page 43: Dreamforce14 Metadata Management with Git Version Control

Where to go next…

John Stevenson

@jr0cket

agileforce.co.uk

Page 44: Dreamforce14 Metadata Management with Git Version Control

Resources

5pm TuesdayUsing Force.com CLI to quickly build, control and automate Salesforce apps

Git Cheetsheetdeveloper.salesforce.com/page/Cheat_Sheets

agileforce.co.uk

Page 45: Dreamforce14 Metadata Management with Git Version Control

Thank you

developer.salesforce.com

John Stevenson

@jr0cket

agileforce.co.uk