Solving the Workflow (or, how MODX.today is being built with git and Gitify)

34
Solving the Workflow Or, how MODX.today is being built with Git & Gitify

Transcript of Solving the Workflow (or, how MODX.today is being built with git and Gitify)

Solving the WorkflowOr, how MODX.today is being

built with Git & Gitify

Who am I?!Mark Hamstra

Founder & CEA at modmore Freelance MODX Developer

Not me

Turbo

Bommel

What is Gitify?

Gitify is not…

• A complete, all-in-one, drag-and-drop solution

• The only way to have a workflow in MODX

• Made of chocolate and bananas

• Feature complete (yet)

But, Gitify is…

• A useful addition to your toolkit

• Flexible to mix & match with other tools

• Built on top of Symfony2 Console

• Improving all the time (w/ help from contributors)

What is MODX.today?

MODX.today

• Daily-ish posts about MODX (articles, interesting forum threads or blog posts, videos, galleries)

• Weekly mailing and podcast

• Open platform, welcoming contributors

github.com/modmore/MODX.today

Installing Gitify

• Go to https://github.com/modmore/Gitify and follow the instructions. Basically, do these steps on the command line:

• $ 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

Running Gitify

Gitify init

• Sets up a new Gitify configuration file interactively.

• —overwrite flag allows you to create a new config file if one already exists.

.gitify filedata_directory: _data/ 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 chunks: class: modChunk primary: name

packages: modx.com: service_url: http://rest.modx.com/extras/ packages: - ace - breadcrumbs - collections - getresources - getcache - seopro - translit - templateselect - wayfinder

Gitify extract

• Looks at your .gitify configuration to extract data from MODX, which is written to files in your data directory.

• No special flags or options.

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]]

Gitify build

• Reads the gitify directory, and builds it into the MODX install

• —force flag clears data first, useful for dealing with conflicts

• —skip-clear-cache flag allows building without clearing cache

Gitify install:modx

• 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.

Gitify install:package

• 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.

• [package_name] argument accepts a partial name of the package which it will then try to find in the package provider.

Now what?

The Workflow

Development

Production

Git Repository

Make a Change in MODX

Gitify extract Deployfrom Git

Commit Changes to GitSynchronise with Git Repository

Gitify build

The Workflow

Development

Production

Git Repository

Make a Change in MODX

Gitify extract Deployfrom Git

Commit Changes to GitSynchronise with Git Repository

Gitify build

The Workflow

Development

Production

Git Repository

Make a Change in MODX

Gitify extract Deployfrom Git

Commit Changes to GitSynchronise with Git Repository

Gitify build

The Workflow

Development

Production

Git Repository

Make a Change in MODX

Gitify extract Deployfrom Git

Commit Changes to GitSynchronise with Git Repository

Gitify build

Make a Changein Gitify Files

Gitify buildTest changein MODX

The Workflow

Development

Production

Git Repository

Make a Change in MODX

Gitify extract Deployfrom Git

Commit Changes to GitSynchronise with Git Repository

Gitify build

The Workflow

Development

Production

Git Repository

Make a Change in MODX

Gitify extract Deployfrom Git

Commit Changes to GitSynchronise with Git Repository

Gitify build

The Workflow

Development

Production

Git Repository‣ develop‣ staging‣ production

Make a Change in MODX

Gitify extract Deployfrom Git

(from theproduction

branch)Commit Changes to Git

Synchronise with Git Repository

Gitify build

The Workflow

Production

Git Repository‣ develop‣ staging‣ production

Development

Make a Change in MODX

Gitify extract

Commit Changes to GitSynchronise with Git Repository

Gitify buildStaging

Make a Change in MODX

Gitify extract

Commit Changes to GitSynchronise with Git Repository

Gitify build

Setting up a Site from Gitify

1. Clone the Repository

2. Install MODX (Gitify install:modx [version])

3. Install defined packages (Gitify install:package —all)

4. Build from files (Gitify build --force)

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 --force)

The Workflow

Production

Git Repository‣ develop‣ staging‣ production

Development

Make a Change in MODX

Gitify extract

Commit Changes to GitSynchronise with Git Repository

Gitify buildStaging

Make a Change in MODX

Gitify extract

Commit Changes to GitSynchronise with Git Repository

Gitify build

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`;

Handling Automatic Deploys (#2)

• Use a CI / Deployment service / tool: dploy.io

The Workflow

Production

Git Repository‣ develop‣ staging‣ production

Development

Make a Change in MODX

Gitify extract

Commit Changes to GitSynchronise with Git Repository

Gitify buildStaging

Make a Change in MODX

Gitify extract

Commit Changes to GitSynchronise with Git Repository

Gitify build

dploy.io

webhook

The Workflow

Production

Git Repository‣ develop‣ staging‣ production

Development

Make a Change in MODX

Gitify extract

Commit Changes to GitSynchronise with Git Repository

Gitify buildStaging

Make a Change in MODX

Gitify extract

Commit Changes to GitSynchronise with Git Repository

Gitify build

manualupdates

404 Slide not Found

The slide you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Perhaps you are looking for :• github.com/modmore/Gitify• github.com/modmore/Gitify/wiki/Home• github.com/modmore/MODX.today

Thank you.