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.

Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)

1,865 views

Published on

Introducing the Gitify workflow toolkit for MODX, talking about the different needs for workflow solutions, specific to the MODX CMS.

Published in: Internet
  • 7 Signs Your Car Battery Is About To Die And Needs To Be Replaced (or reconditioned) ➤➤ http://t.cn/AiFAGBwT
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)

  1. 1. Dev, Staging & Production Workflow with Gitify Mark Hamstra, @mark_hamstra
  2. 2. What is a Dev/Stage/ Production Workflow?
  3. 3. What is a Dev/Stage/ Production Workflow? • One site or project
  4. 4. What is a Dev/Stage/ Production Workflow? • One site or project • Replicated across separated environments, each potentially in a completely different state
  5. 5. What is a Dev/Stage/ Production Workflow? • One site or project • Replicated across separated environments, each potentially in a completely different state • Tailored to the team, environment or business processes
  6. 6. modx.com/blog/2015/11/16/your-website-just-got-a-promotion/
  7. 7. Requirements for a workflow that actually works
  8. 8. Requirements for a workflow that actually works • Automation
  9. 9. Requirements for a workflow that actually works • Automation • Automation
  10. 10. Requirements for a workflow that actually works • Automation • Automation • str_repeat(‘Automation’, PHP_INT_MAX);
  11. 11. Requirements for a workflow that actually works • Automation • Automation • str_repeat(‘Automation’, PHP_INT_MAX); • Accessible to the different stakeholders
  12. 12. Requirements for a workflow that actually works • Automation • Automation • str_repeat(‘Automation’, PHP_INT_MAX); • Accessible to the different stakeholders • Easy to rollback
  13. 13. Requirements for a workflow that actually works • Automation • Automation • str_repeat(‘Automation’, PHP_INT_MAX); • Accessible to the different stakeholders • Easy to rollback • Able of dealing with conflicting changes
  14. 14. To be able of replicating environments and automating a workflow, you need a single source of truth.
  15. 15. How to deal with all of this?
  16. 16. How to deal with all of this? Git!
  17. 17. How to deal with all of this? Git! • Manages state of files
  18. 18. How to deal with all of this? Git! • Manages state of files • Can handle conflicts automatically + manually
  19. 19. How to deal with all of this? Git! • Manages state of files • Can handle conflicts automatically + manually • Easy to automate through simple CLI api
  20. 20. How to deal with all of this? Git! • Manages state of files • Can handle conflicts automatically + manually • Easy to automate through simple CLI api • Can be made more accessible through GUI clients and services (like GitHub)
  21. 21. To be able of replicating environments and automating a workflow, the git repository needs to be the single source of truth.
  22. 22. How to deal with all of this…on a MODX project?
  23. 23. How to deal with all of this…on a MODX project? • Store assets, custom components and relevant files in git
  24. 24. How to deal with all of this…on a MODX project? • Store assets, custom components and relevant files in git • … missing the important bits! • Content • Elements (templates,TVs, chunks, snippets, plugins) • Other information stored in the database
  25. 25. How do we get information in our database into a format that unlocks the potential of git?
  26. 26. Gitify!
  27. 27. What is Gitify? • Command line toolkit • Written with Symfony 2 Console
  28. 28. What can Gitify do?
  29. 29. What can Gitify do? • Write information from the database to files Gitify extract
  30. 30. What can Gitify do? • Write information from the database to files Gitify extract • Write information from those files into the database Gitify build
  31. 31. Built-in magic
  32. 32. Built-in magic • Automatic ID conflict resolution
  33. 33. Built-in magic • Automatic ID conflict resolution • Automatic orphan cleanup
  34. 34. Gitify bridges the gap between the database and your git repository
  35. 35. Project Configuration • .gitify file in root of project • Specifies data • Specifies packages to install
  36. 36. So how does the workflow work?
  37. 37. Different environments have different workflow needs.
  38. 38. Putting it together Git - develop - staging - production localhost stage.site.com site.com
  39. 39. Dev Workflow Make changes in MODX Run `Gitify extract` Commit to repository and push
  40. 40. File-based Dev Workflow Make changes in Data Files Run `Gitify build` Test changes in MODX Commit to repository and push
  41. 41. Putting it together Git - develop - staging - production localhost stage.site.com site.com manual
  42. 42. Staging Workflow Editor team makes content changes in MODX Automatically extracted Automatically committed to staging branch Automatically pushed
  43. 43. Putting it together Git - develop - staging - production localhost stage.site.com site.com manual automated
  44. 44. Production Workflow Don’t make changes on production
  45. 45. Production Workflow Don’t make changes on production (or use the same workflow as staging if you must)
  46. 46. Production Workflow Don’t make changes on production (or use the same workflow as staging if you must) (but really, you shouldn’t)
  47. 47. Setting automatic deployments
  48. 48. Deploying with Gitify • git fetch origin • git reset --hard %COMMIT% • git pull origin %BRANCH% • Gitify backup deploy_%TIMESTAMP_UTC% • # Gitify package:install --all • Gitify build
  49. 49. Creating new environments
  50. 50. Creating new environments 1. Clone the repository
  51. 51. Creating new environments 1. Clone the repository 2. Install MODX (Gitify modx:install)
  52. 52. Creating new environments 1. Clone the repository 2. Install MODX (Gitify modx:install) 3. Install dependent packages (Gitify package:install — all)
  53. 53. Creating new environments 1. Clone the repository 2. Install MODX (Gitify modx:install) 3. Install dependent packages (Gitify package:install — all) 4. Build the data (Gitify build [--force])
  54. 54. Putting it together Git - develop - staging - production localhost stage.site.com site.com manual automated automated
  55. 55. But how do we automatically extract, commit and push?
  56. 56. Introducing Gitify Watch
  57. 57. X
  58. 58. Gitify Watch
  59. 59. Gitify Watch • Works with Scheduler
  60. 60. Gitify Watch • Works with Scheduler • Triggers on saving resources and elements
  61. 61. Gitify Watch • Works with Scheduler • Triggers on saving resources and elements • Automatically extracts, commits & pushes data
  62. 62. Gitify Watch
  63. 63. Gitify Watch • Free
  64. 64. Gitify Watch • Free • github.com/modmore/GitifyWatch
  65. 65. Gitify Watch • Free • github.com/modmore/GitifyWatch • Package via modmore.com before holidays
  66. 66. Gitify can do more!
  67. 67. Install & Upgrade MODX Gitify modx:install [version] Gitify modx:upgrade [version]
  68. 68. Install MODX packages Gitify package:install [name] [--version]
  69. 69. Backup & Restore Gitify backup [name] Gitify restore [name]
  70. 70. Links & More Info • Source: github.com/modmore/Gitify • Docs: github.com/modmore/Gitify/wiki and modmore.github.io/Gitify/ • GitifyWatch: github.com/modmore/GitifyWatch • Example Gitify projects: • github.com/modmore/MODX.today • github.com/modmore/demo.modmore.com
  71. 71. Thank you @mark_hamstra - @modmore markhamstra.com - modmore.com

×