![Page 1: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/1.jpg)
Solving the Workflowor how MODX.today is being managed
across 3 servers with Git & Gitify
![Page 2: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/2.jpg)
Who am I?!Mark Hamstra
Founder & CEA at modmore Freelance MODX Developer
Not me
Turbo
Bommel
![Page 3: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/3.jpg)
Solving the Workflow
Introducing the project: MODX.today
Introducing the tools: Gitify & Git
Putting it together: designing a Workflow
Setting up automatic deployments
![Page 4: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/4.jpg)
What is MODX.today?
![Page 5: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/5.jpg)
MODX.today
• Daily-ish posts about MODX
• Weekly newsletter / reading list
• Open source, looking for guest authors
• Launched April 22nd
• 5500+ pageviews, average time on site 2:25 min
![Page 6: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/6.jpg)
![Page 7: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/7.jpg)
![Page 8: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/8.jpg)
![Page 9: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/9.jpg)
![Page 10: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/10.jpg)
![Page 11: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/11.jpg)
![Page 12: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/12.jpg)
![Page 13: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/13.jpg)
![Page 14: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/14.jpg)
github.com/modmore/MODX.today
![Page 15: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/15.jpg)
Solving the Workflow
Introducing the project: MODX.today
Introducing the tools: Gitify & Git
Putting it together: designing a Workflow
Setting up automatic deployments
![Page 16: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/16.jpg)
What is Gitify?
![Page 17: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/17.jpg)
Gitify is not…
• A complete, all-in-one, drag-and-drop solution with a fancy user interface with buttons and animations
• The only way to have a workflow in MODX
![Page 18: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/18.jpg)
But, Gitify is…
• A useful addition to your toolkit
• Flexible to mix & match with other tools
• Built on top of Symfony2 Console
• Open source!
![Page 19: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/19.jpg)
With Gitify, you can…
• easily create file representations of any object
• create a functional site from those files
• install MODX and packages
• create mysql backups (and restore them)
![Page 20: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/20.jpg)
Installing Gitify
• Go to https://github.com/modmore/Gitify and follow the instructions. Basically:
• $ git clone https://github.com/modmore/Gitify.git Gitify
• $ cd Gitify
• $ composer install (or php composer.phar install)
• $ chmod +x Gitify
• Add Gitify to your $PATH - check the wiki
![Page 21: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/21.jpg)
Running Gitify
![Page 22: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/22.jpg)
$ Gitify init• Sets up a new Gitify configuration
file interactively.
• --overwrite flag allows you to create a new config file if one already exists.
![Page 23: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/23.jpg)
.gitify filedata_directory: _data/ backup_directory: _backup/ data: contexts: class: modContext primary: key content: type: content exclude_keys: - editedby - editedon categories: class: modCategory primary: category templates: class: modTemplate primary: templatename template_variables: class: modTemplateVar primary: name
packages: modx.com: service_url: http://rest.modx.com/extras/ packages: - ace - breadcrumbs - collections - getresources - getcache - seopro - translit - templateselect - wayfinder
![Page 24: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/24.jpg)
$ Gitify extract
• Looks at your .gitify configuration to extract data from MODX, which is written to files in your data directory.
• Allows specifying any number of partitions (directories/types) you want extracted
![Page 25: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/25.jpg)
Gitify Extract (#2)id: 4 templatename: 'Empty Content' description: 'Default Template with empty Content Area' properties: 'a:0:{}'
-----
[[$template.head]] [[$template.header]] <!-- #content --> <div id="content" role="main"> [[*content]] </div> <!-- / #content --> [[$template.footer]]
![Page 26: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/26.jpg)
• Reads the gitify directory, and builds it into the MODX install
• —force flag clears all data first
• —skip-clear-cache flag allows building without clearing cache
• —no-backup allows skipping creating a backup with —force
• —no-cleanup allows skipping cleaning up orphaned objects
$ Gitify build
![Page 27: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/27.jpg)
![Page 28: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/28.jpg)
Build Magic
• Automatically resolves ID conflicts by analysing existing and already built objects
• Cleans up orphaned objects from the database
• Still respects where conditions in .gitify
![Page 29: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/29.jpg)
$ Gitify modx:install
• Downloads and installs a version of MODX all from the command line.
• [modx_version] argument lets you define a version (e.g. 2.3.2-pl) that will be installed. Without it, the latest version will be grabbed.
![Page 30: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/30.jpg)
$ Gitify package:install
• Downloads and installs a package (extra) into the MODX installation.
• —all option will look at the .gitify file and automatically install each of the packages defined there.
• —interactive option allows to interactively search and install packages when used with —all.
• [package_name] argument accepts a partial name of the package which it will then try to find in the package provider.
![Page 31: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/31.jpg)
$ Gitify backup
• Creates a backup of your MySQL database using mysqldump
• [name] the filename for the backup file
![Page 32: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/32.jpg)
$ Gitify restore
• Restores a backup created with Gitify backup.
• [file] If you know the filename, you can pass it directly. Otherwise you will get an interactive list of the available backups that can be restored.
![Page 33: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/33.jpg)
Solving the Workflow
Introducing the project: MODX.today
Introducing the tools: Gitify & Git
Putting it together: designing a Workflow
Setting up automatic deployments
![Page 34: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/34.jpg)
The WorkflowGit Repository
![Page 35: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/35.jpg)
The WorkflowGit Repository
develop production
staging
![Page 36: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/36.jpg)
The Workflow
site.com
Git Repository
site.dev
staging.site.com
develop production
staginggit push
git pull
git p
ush
git p
ull
git pull
![Page 37: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/37.jpg)
The Workflow
site.com
Git Repository
site.dev
staging.site.com
develop production
staginggit merge git merge
![Page 38: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/38.jpg)
The Workflow
site.com
Git Repository
staging.site.com
develop production
staging
site.dev
Commit Changes to GitSynchronise with Git Repository
Gitify extract
Build stuff in MODX
Gitify build
![Page 39: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/39.jpg)
The Workflow
site.com
Git Repository
staging.site.com
develop production
stagingCommit Changes to Git
Synchronise with Git Repository
(Gitify extract)
Make a Changein Gitify Files
Gitify build
Test changes
site.dev
![Page 40: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/40.jpg)
The Workflow
site.com
Git Repository
site.dev
staging.site.com
develop production
staging
![Page 41: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/41.jpg)
The Workflow
site.com
Git Repository
site.dev
develop production
staging
Gitify WatchSchedules Extract
Make change in MODX
staging.site.com
Gitify extractgit add -a
git commit
git pu
sh
![Page 42: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/42.jpg)
The Workflow
site.com
Git Repository
site.dev
staging.site.com
develop production
staging
![Page 43: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/43.jpg)
The Workflow
site.com
Git Repository
site.dev
staging.site.com
develop production
staging deploy
![Page 44: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/44.jpg)
Solving the Workflow
Introducing the project: MODX.today
Introducing the tools: Gitify & Git
Putting it together: designing a Workflow
Setting up automatic deployments
![Page 45: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/45.jpg)
Setting up a Site from Gitify
1. Clone the Repository, checkout proper branch
2. Install MODX (Gitify modx:install
[version])
3. Install defined packages (Gitify
package:install —all)
4. Build from files (Gitify build)
![Page 46: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/46.jpg)
Updating a Site from Gitify
1. Pull in the latest version of the repository
2. Install defined packages (Gitify install:package —all)
3. Build from files (Gitify build)
![Page 47: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/47.jpg)
Handling Automatic Deploys (#1)
• Use a Github/Gitlab/Bitbucket webhook that requests a PHP script like this:
<?php
`git fetch origin`;
`git reset --hard origin/production`;
`git pull origin production`;
`Gitify install:package —all`;
`Gitify build —force`;
![Page 48: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/48.jpg)
Handling Automatic Deploys (#2)
• Use a CI / Deployment service / tool: dploy.io
![Page 49: Solving the Workflow - Building MODX.today with Gitify (2015-05-21, Alkmaar)](https://reader034.vdocuments.net/reader034/viewer/2022042818/55c0869cbb61eb082d8b480b/html5/thumbnails/49.jpg)
The End
Useful links:
• MODX.today• MODX.today/submit• github.com/modmore/Gitify• github.com/modmore/Gitify/wiki/Home• github.com/modmore/MODX.today