Post on 22-Apr-2015
description
API Series: Metadata API October 02, 2013
#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.
#forcewebinar
Speakers
Raj Chowhan Sr. Technical Solution Architect @rajanchowhan
Srinivasan Thirumalai Technical Solution Architect
@srinithirumalai
#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
#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
#forcewebinar
Change: Needed but Often Feared
http://www.flickr.com/photos/20408885@N03/3570184759
#forcewebinar
The Metadata Home
Accounts Contacts Products
Custom Object Custom Code
Custom Fields Custom Workflows
#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!
#forcewebinar
Metadata API Nouns
#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>
#forcewebinar
Deploy() "ow
#forcewebinar
Demo 1: Deploy using ANT
#forcewebinar
Deployment Tools
#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
#forcewebinar
Force.com IDE (Eclipse) 1. Choose file(s) and deploy
2. Credentials
3. Backup destination incase you need to rollback!
#forcewebinar
Force.com IDE (Eclipse)
3. IDE works out the differences (new additions versus overwrite)
#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.
#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.
#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.
#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
#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
#forcewebinar
Files build.xml
package.xml build.properties
#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
#forcewebinar
Source Control
#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
#forcewebinar
Demo 2: Connect a subversion repository
#forcewebinar
Continuous Integration
#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.
#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
#forcewebinar
Demo 3: Continuous Integration Demo
#forcewebinar
Build Pipelines
#forcewebinar
Build Pipelines
§ An automated implementation of your system’s build, deploy, test, release process
#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
#forcewebinar
Demo 4: Deployment between environments
#forcewebinar
New Features
#forcewebinar
Faster Deploys to Production (Pilot)
Only Run Specified Tests Must Cover Code Changes 75% Coverage Per Class Force.com Migration Tool
#forcewebinar
Smart User Matching on Deploy
AFTER me@myco.com = me@myco.com.dev = me@myco.com.full
BEFORE me@myco.com != me@myco.com.dev != me@myco.com.full
#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
#forcewebinar
Summary
§ The API and its characteristics
§ The tools to access it
Crawl Walk Run Fly!
ANT Source Control
Continuous Integration
Continuous Delivery
#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/
#forcewebinar
Q&A
Raj Chowhan Sr. Technical Solution Architect @rajanchowhan
Srinivasan Thirumalai Technical Solution Architect
@srinithirumalai