Dreamforce14 Metadata Management with Git Version Control

Post on 01-Dec-2014

955 views 2 download

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

Managing changes in your Salesforce Org with Git

agileforce.co.uk

John Stevenson

@jr0cket

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.

Why manager changes in your Salesforce Org?

John Stevenson

@jr0cket

agileforce.co.uk

Keeping a record of change

Understand:

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

So, what is Git ?

John Stevenson

@jr0cket

agileforce.co.uk

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

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

How do you use Git

GithubRepository

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=“jstevenson@salesforce.com”

Github for Mac / Windows – Simple start point

So, what is Github ?

John Stevenson

@jr0cket

agileforce.co.uk

“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

Getting Started with Github

Github account from github.com

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

Lets use Git & Github to manage our Salesforce Org

John Stevenson

@jr0cket

agileforce.co.uk

Create a repository on Github

Screenshots from blog post

1. Add repository

1. Select “Clone”

1. Type name of repository to clone

1. Clone repository to your computer

Show me the Metadata

John Stevenson

@jr0cket

agileforce.co.uk

developer.salesforce.com/page/Force.com_IDE

Force.com IDE

- Apex- Visualforce

pages- Unit Tests- Git

MavensMate.comSublime Text plugin for Force.com

- Apex- Visualforce - Unit Tests- Git

- Lightweight- Templates

Force.com Command Line Interface(CLI)

force-cli.heroku.com

Packaging up the Gardening App

John Stevenson

@jr0cket

agileforce.co.uk

The Gardening App

I created a Salesforce App called Gardening

Create a new package

I just want to version my Gardening App

Creating an unmanaged package

The Gardening App to the package

The Gardening App is now packaged

Using Force CLI to get your Metadata

John Stevenson

@jr0cket

agileforce.co.uk

So what is Git

force-cli.herokuapp.com

Connect Force CLI to your Salesforce Org

Using OAuth secure connection

force login

Connect Force CLI to your Salesforce Org

From the directory created by the Github client

force fetch package DreamforceHack --unpack

Versioning your Metadata

John Stevenson

@jr0cket

agileforce.co.uk

Github Client picks up changes automatically

Github Client picks up changes automatically

Github Client picks up changes automatically

Github Client picks up changes automatically

Github Client picks up changes automatically

Where to go next…

John Stevenson

@jr0cket

agileforce.co.uk

Resources

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

Git Cheetsheetdeveloper.salesforce.com/page/Cheat_Sheets

agileforce.co.uk

Thank you

developer.salesforce.com

John Stevenson

@jr0cket

agileforce.co.uk