Updated with the deck from DF14
As a fully certified TA, I offer expert consulting services around continuous integration, practice development and governance to help customers leveraging the advantages of SFDC.
https://uk.linkedin.com/in/se6wagner/
Abstract:
Automating the deployment between environments (dev, test, prod, etc.) gives consistency, visibility, and validation to the process.This greatly speeds up deployment and provides early detection of defects. Join us as we cover the theory and best practices of this approach. You'll discover how to design your own automated processes using Continuous Integration (CI) tools and Git version control.
DSPy a system for AI to Write Prompts and Do Fine Tuning
Automating Deployment Between Orgs Using Git & Continuous Integration
1. Automating Deployments
Between Orgs Using
Git and Continuous Integration
Sebastian Wagner
Freelance Certified Technical Architect
www.linkedin/in/se6wagner
2. 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 andcustomer 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 any litigation, risks associated with completed and any 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 year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These 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.
7. Challenges and Issues
• keeping orgs in sync as a team
• changes get overwritten by other developers
• amount of time required for manual deployment
• conflicts / errors discovered late in the process
• limited traceability of changes
13. Approach – Components
• Salesforce Orgs for Development
– Sandboxes
– DE Orgs
• Git for Source Code Management
– Github or bitbucket.org for hosting
– Command Line / SourceTree / other as a client
• Continuous Integration for automated deployments
– Jenkins or Bamboo for orchestration
– Ant & Force.com Migration Toolkit for deployment
14. Approach – Salesforce Orgs
• separate Salesforce Org per developer
• dedicated CI Salesforce Org
– where all features will be integrated and compiled
• Salesforce Org for stages in SDLC
– QA (with integrated QA can be done in CI)
– UAT
– Pre-Prod
15. Approach - git
• store source code & metadata
– Apex and Visualforce Code
– min. include referenced components required for deployment
• track changes
• isolate features and stages of the SDLC
– branches for isolation of features and stages
– tags for releases and versioning
• store supporting resources
– reference/ config data for migration
– Integration config, test scripts, etc,
17. Approach - CI
• Automation
– ant based deployment from git repository
– execution of supporting tasks
– notifications on build errors
– Reporting
• Setup
– data migration (test and/or config data)
– execution of setup scripts
• Testing
– Unit test execution
– UI test execution
19. when a build has no errors
http://thecodinglove.com/post/86204416476/when-a-build-has-no-errors
20. Benefits
• Source Code ‘Backup’
• Automation
– automated deployment to multiple orgs
– automated test execution
– eliminate human error from deployment
• Visibility – The 5Ws of a change
– Who What When Where Why
• Validation
– issues get detected early in the process
– resolve issues close to cause
21. Best Practices
• start simple
• automate as much as possible
• integrate with your ticketing system
• use git branching model and tags
• pull requests to merge features
• commit & build regularly
• maintain destructive changes log
24. BP – Gitflow Branching
• Master
– The holy grail aka Production
• Hotfix
– maintenance outside of dev
• Release
– ready for UAT
• Develop
– main development stream
• Feature
– individual feature / story
www.atlassian.com/git/workflows
25. BP – Gitflow Orgs
www.atlassian.com/git/workflows
26. BP – Pull Requests
• Review Code
– natural stage gate for reviewing code
– comment and refactor
• Accept and Merge
– accept changes
– merge to target branch
www.atlassian.com/git/workflows#!pull-request
27. BP – Pull Requests
www.atlassian.com/git/workflows#!pull-request
28. BP – Pull Requests
www.atlassian.com/git/workflows#!pull-request
29. BP – Pull Requests
www.atlassian.com/git/workflows#!pull-request
30. BP – Pull Requests
www.atlassian.com/git/workflows#!pull-request
31. BP – Commit & Build
• Commit & Push frequently
– refresh from server frequently to incl. all metadata fields
– push to remote at least daily
– integrate Config orgs through change sets
• Pull frequently
– pull and merge changes to sync with other developers
– save against org
• Build regularly
– frequency dependent on execution time
– execute non Managed Package tests for performance
– run with validateOnly in single sandbox scenario
32. Summary
• Do it!
• Build!
• What to do next
– Know your Metadata
– Learn Git (https://try.github.io)
– Set up tools to match your workflow
• Search / Ask Questions
– DevZone
– Developer Forums
– Salesforce StackExchange
33. Services
You are looking for help setting up or optimizing Continuous Integration?
I offer expert services for
• Solution Design
• Design Authority
• Platform Governance
• Practice Development and Dev Ops
For more details feel free to reach out via LinkedIn
www.linkedin.com/in/se6wagner
34.
35. References
Force.com Development Lifecycle Guide
http://bit.ly/sf-dlc
Force.com Migration Tool Guide
http://bit.ly/sf-ant
Developer Wiki – CI Techniques
https://developer.salesforce.com/page/Bestpractices:Continuous_Integration_Techniques
Mark Cane - CI Thoughts
http://blog.force365.com/2012/04/16/salesforce-continuous-integration/
Anup Jadhav – CI with Bamboo
http://anupjadhav.com/2013/03/11/salesforce-CI-bamboo-jira/
Jeff Douglas – CI with Jenkins
http://blog.jeffdouglas.com/2013/03/18/setting-up-continuous-integration-for-saleforce-development
Editor's Notes
1
1
Key Takeaway:We are a publicly traded company. Please make your buying decisions only on the products commercially available from Salesforce.com.
Talk Track:
Before I begin, just a quick note that when considering future developments, whether by us or with any other solution provider, you should always base your purchasing decisions on what is currently available.
2
1
2
Who has done a deployment?
Have you used change sets
Have you used Force.com IDE
Have you used a built server?
Who has been working with CI?
Who’s using git already?
Who has made changes directly in production?