salesforce api series: release management with the metadata api webinar

41
API Series: Metadata API October 02, 2013

Upload: salesforce-developers

Post on 22-Apr-2015

3.093 views

Category:

Technology


1 download

DESCRIPTION

The Metadata API allows you to make changes to your Salesforce instance and then deploy those changes through sandboxes to production. There are many tools, both Salesforce-provided or community developed, that allow you to interact with the Metadata API. The API is a fundamental part of release management but actually managing the “change” is what literally makes or breaks an implementation. This webinar focuses on building automation into your release management process using commonly available enterprise tools. Key Takeaways :: Learn about the Metadata API and some common API calls :: Explore the tools built on top of the API :: Learn how to leverage a version control system manage multiple development streams :: Build deployment pipelines with automated testing Intended Audience :: Force.com Developers / Quality Assurance, Technical Leads, Architects, Application Directors

TRANSCRIPT

Page 1: Salesforce API Series: Release Management with the Metadata API webinar

API Series: Metadata API October 02, 2013

Page 2: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

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 product or service availability, 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, new products and services, 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, the outcome of intellectual property and other litigation, 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-Q for the most recent fiscal quarter ended July 31, 2012. This documents and others containing important disclosures 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 presentations, 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: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Speakers

Raj Chowhan Sr. Technical Solution Architect @rajanchowhan

Srinivasan Thirumalai Technical Solution Architect

@srinithirumalai 

Page 4: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Follow Developer Force for the Latest News

@forcedotcom / #forcewebinar

Developer Force – Force.com Community

+Developer Force – Force.com Community

Developer Force

Developer Force Group

Page 5: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Agenda

§  What is the API?

§  How can I access it?

§  ANT: The what, where and how?

§  Version Control

§  Continuous Integration

§  Build Pipelines

§  New Features

Page 6: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Change: Needed but Often Feared

http://www.flickr.com/photos/20408885@N03/3570184759

Page 7: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

The Metadata Home

Accounts Contacts Products

Custom Object Custom Code

Custom Fields Custom Workflows

Page 8: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

What is the API?

§  Text-based (XML) version of an org

§  ALL Most tools use the metadata API –  See last slide on the Tooling API!

§  SOAP based and Asynchronous (poll for updates)

§  File and CRUD calls –  File-based = Deploy(), Retrieve()

–  CRUD based = more granular

§  Not complete but getting closer on every release!

Page 9: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Metadata API Nouns

Page 10: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

What is Metadata?

Create your database

tables

Define schema

attributes

Create new database

fields

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> <label>PTORequest</label> <pluralLabel>PTORequests</pluralLabel> <nameField> <label>PTORequest Name</label> <type>Text</type> </nameField> <sharingModel>ReadWrite</sharingModel> <fields> <fullName>StartDate__c</fullName> <label>Start Date</label> <type>Date</type> </fields> <fields> <fullName>Duration__c</fullName> <label>Duration</label> <type>Number</type> <precision>2</precision> </fields> <deploymentStatus>Deployed</deploymentStatus> </CustomObject>

Page 11: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Deploy() "ow

Page 12: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Demo 1: Deploy using ANT

Page 13: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Deployment Tools

Page 14: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Change Sets Upload, Deploy

Packaging Upload, Install

Metadata API Retrieve, Deploy

Force Migration Tool C:\

ISV Friendly

IT Friendly

Tools built on top of tools

Page 15: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Force.com IDE (Eclipse) 1. Choose file(s) and deploy

2. Credentials

3. Backup destination incase you need to rollback!

Page 16: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Force.com IDE (Eclipse)

3. IDE works out the differences (new additions versus overwrite)

Page 17: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Pros

§  Single place for developers

§  Can easily traverse metadata #les

§  Automatic package.xml generation

Cons

§  No automation

§  Hard to govern when/what changes

§  Can become tedious for repeated deployment retries

§  Does not run tests between sandboxes

§  Must migrate whole objects versus individual #elds, rules etc

Force.com IDE (Eclipse)

Summary Good for smaller teams where the developer and release manager role are the same person. Useful for small changes between sandboxes.

Page 18: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Change Sets

§  When you want to send customizations from your current organization to another organization, you create an outbound change set. Once you send the change set, the receiving organization sees it as an inbound change set.

§  Sending a change set between two organizations requires a deployment connection.

Page 19: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Pros

§  Non-developer skillset

§  Simple, declarative interface

§  Handles dependencies

§  History of migration maintained in org itself

Cons

§  No automation

§  Does not run tests between sandboxes

§  Cannot modify change sets, must create new

§  Does not scale well.

Change Sets

Summary Smaller orgs with non-developer skillset. More configuration than code in the org. Migrating single items (fields) is easier.

Page 20: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

ANT Migration Tool

§  Java/Ant-based command-line utility

§  ANT “tasks” wrap the metadata API calls for ease of use. Also has pre-built tasks for source control systems

§  Build automation tools can call ANT scripts

§  Three #les the are important –  package.xml

–  build.xml

–  build.properties

Page 21: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

ANT Migration Tool: What?, How?, Where?,

§  package.xml = What to deploy

§  build.xml = How to deploy. Called by ANT to orchestrate e.g. checkout, deploy

§  build.properties = Where. best practice to use properties #le for variables like username, password, instance

Page 22: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Files build.xml

package.xml build.properties

Page 23: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Pros §  Can be integrated into

automated test/build systems

§  Integration to source control

§  Run tests between sandboxes

Cons §  Overhead to setup initially

§  Requires developer skillset

§  Still limited my metadata API, so still some manual tasks

ANT Migration Tool

Summary Enterprises with existing build/release management infrastructure. Overlap with .net/java/ruby best practices around automation and continuous integration

Page 24: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Source Control

Page 25: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Source Control

§  AKA version control system, revision control §  Track changes to SFDC metadata §  SFDC has no native source control integration (org ->

source control) §  Most systems allow multiple developers opening the

same #le (merge later vs #le locks) §  2 main "avors

–  Centralized (client/server): Subversion, perforce –  Distributed (peer-to-peer): Git, Mecurial

Page 26: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Demo 2: Connect a subversion repository

Page 27: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Continuous Integration

Page 28: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Continuous Integration

§  Continuous Integration (CI) is a technique used to quickly identify the many issues that arise when integrating code. Code repositories and build servers are core components.

Page 29: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Jenkins

§  Open Source continuous integration tool

§  Easy installation using java .war #le

§  Pre-built connectors to source control systems

§  Test framework support (UI tests, Coding Standards etc)

§  300+ plugins! Incluing Jenkins2Chatter! https://github.com/superfell/HudsonChatterPlugin

Page 30: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Demo 3: Continuous Integration Demo

Page 31: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Build Pipelines

Page 32: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Build Pipelines

§  An automated implementation of your system’s build, deploy, test, release process

Page 33: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Build Pipeline

Production Instance

Full (E-Releases)

QA

legend

Training Dev QA Fix

Innovation

Rollup

Major Release Path

Integrate changes Emergency Releases

Pulls

Sprint 1

Sprint 1

Sprint 2 Fix 1 Fix 1

Fix 1 Sprint 1 Sprint 2

Sprint 3

Innovation

Innovation Sprint 2 Sprint3 +

Innovation

Sprint 4

live

full copy

Developer PRO, test data

Developer PRO, training data

developer

Page 34: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Demo 4: Deployment between environments

Page 35: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

New Features

Page 36: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Faster Deploys to Production (Pilot)

Only Run Specified Tests Must Cover Code Changes 75% Coverage Per Class Force.com Migration Tool

Page 37: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Smart User Matching on Deploy

AFTER [email protected] = [email protected] = [email protected]

BEFORE [email protected] != [email protected] != [email protected]

Page 38: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Tooling API §  The Tooling API is designed for developing user interface

tools to interact with the development artifacts in orgs.

§  It can be accessed via SOAP and ReST

§  Developer Console is largely built on the tooling API

Page 39: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Summary

§  The API and its characteristics

§  The tools to access it

Crawl Walk Run Fly!

ANT Source Control

Continuous Integration

Continuous Delivery

Page 40: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Resources

§  Metadata API Developer's Guide §  http://www.salesforce.com/us/developer/docs/api_meta

§  Force.com Migration Tool Guide §  http://www.salesforce.com/us/developer/docs/daas/index.htm

§  Jenkins §  http://jenkins-ci.org/

Page 41: Salesforce API Series: Release Management with the Metadata API webinar

#forcewebinar

Q&A

Raj Chowhan Sr. Technical Solution Architect @rajanchowhan

Srinivasan Thirumalai Technical Solution Architect

@srinithirumalai