Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Automating Deployment Between Orgs Using Git & Continuous Integration

10,610 views

Published on

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.

Published in: Technology
  • Login to see the comments

Automating Deployment Between Orgs Using Git & Continuous Integration

  1. 1. Automating Deployments Between Orgs Using Git and Continuous Integration Sebastian Wagner Freelance Certified Technical Architect www.linkedin/in/se6wagner
  2. 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.
  3. 3. Sebastian Wagner Certified Technical Architect
  4. 4. “I cannot teach anybody anything, I can only make them think” Socrates
  5. 5. Agenda • Challenges and Issues • Multi-Org Scenarios • Approach • Benefits • Best Practices • Q&A
  6. 6. deploying to production on a Friday afternoon
  7. 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
  8. 8. Scenarios - SDLC development QA user acceptance tests deployment
  9. 9. Scenarios – Single Sandbox
  10. 10. Scenarios – SDLC Environments
  11. 11. Approach – Before The Silver Bullet
  12. 12. Approach – (Not) The Silver Bullet
  13. 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. 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. 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,
  16. 16. Approach – git (commands) • git clone • git commit • git push • git pull • force deploy
  17. 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
  18. 18. Approach - CI
  19. 19. when a build has no errors http://thecodinglove.com/post/86204416476/when-a-build-has-no-errors
  20. 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. 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
  22. 22. BP – Ticketing Integration
  23. 23. BP – Ticketing Integration
  24. 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. 25. BP – Gitflow Orgs www.atlassian.com/git/workflows
  26. 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. 27. BP – Pull Requests www.atlassian.com/git/workflows#!pull-request
  28. 28. BP – Pull Requests www.atlassian.com/git/workflows#!pull-request
  29. 29. BP – Pull Requests www.atlassian.com/git/workflows#!pull-request
  30. 30. BP – Pull Requests www.atlassian.com/git/workflows#!pull-request
  31. 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. 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. 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. 34. 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

×