Using Xenforo with 3 stage development environment

magnusman

New member
We're looking to move to XF from VB 4.2. We currently use a deployment process based on Git and Deploy.io to move features/changes on our VB/WP hybrid site from the developer's local install, to our development instance, then to staging and finally production, syncing with and pushing/pulling to/from the git repo as needed.

We follow the Git methodology highlighted in this thread:. https://xenforo.com/community/threa...ic-production-sites-release-management.87146/

It appears that at least when the above thread was created, @jakew009 couldn't get XF working with Git without jumping through some hoops.

Can you share any details about using XF with Git/version control or any recommended deploymeent processes/plugins that exist today that could help us out?

Thanks!
 
Last edited:
I'm not sure how that would work, as everything on XF is stored in the database (options, add-on installations and data etc.).

Only the actual files are on the file system, and the actual information is in the database... So, you'd need some way to sync database updates on git with the production database.

Liam
 
Not directly related, but: Instead of having one giant codebase, I would suggest splitting each distinct functionality into their own addons. When an addon is updated, update the relevant files. If migrations are necessary, bump the version ID and trigger an update.
 
Not directly related, but: Instead of having one giant codebase, I would suggest splitting each distinct functionality into their own addons. When an addon is updated, update the relevant files. If migrations are necessary, bump the version ID and trigger an update.

I think the issue is mainly related to data/configs/plugin specific data/templates being stored in the DB as opposed to in the filesystem. From the thread I referenced, @jakew009 stated he was thinking of creating a tool that would:

We are thinking of writing some sort of tool that

a) lets you store all the templates in the filesystem and then syncs them with the database (allowing you to store the templates in GIT and easily revert / see history).

b) Some sort of database migration system that lets you deploy an addon to production without having to go through the rigmarole of actually installing and configuring said addon on production.
 
@magnusman, What did you eventually come up with regarding deploying XenForo? I too am stuck with a similar problem, I find tons of threads asking this same question (XF + Git + Deployments), but with no real solutions. I have a feeling everybody gives up and manages deployments manually. I personally think this method is insane, but there doesn't seem to be any good alternatives for XF. I hope you found something to make this at least a little easier.
 
@magnusman, What did you eventually come up with regarding deploying XenForo? I too am stuck with a similar problem, I find tons of threads asking this same question (XF + Git + Deployments), but with no real solutions. I have a feeling everybody gives up and manages deployments manually. I personally think this method is insane, but there doesn't seem to be any good alternatives for XF. I hope you found something to make this at least a little easier.

Still in the discovery phase. Was hoping for more actual real-world examples of automation tools and deployment methods. Will also be looking at add-on installer. Thanks for the mention, @Xon.
 
I store each add-on in its own git repository with a git-flow setup (master/develop branches, etc). I do work on the develop branch and merge into to master when a new version is ready to be deployed. I wrote a build script that automatically exports the add-on XML from the local development copy and performs other pre-release tasks. I use it when merging from develop into master. You might be able to automate this with a pre-commit git hook, but I haven't bothered so far.

Then, on the server side, I can pull from the master branch. I have additional scripts on the server that import the add-on XML from the repository, which takes care of templates and such, and also symlinks JavaScripts and images into place. You could probably use a post-receive hook here too, but again I haven't bothered yet.

Then I have another script that goes through each add-on in my vendor directory, attempts to pull from master, and runs the above script if there were any changes pulled in. I run this script manually, but it could be automated through cron/systemd timers if I really wanted. This effectively automates deployment enough for my needs.

My scripts are highly tailored to my needs/setup, but I'm happy to answer any questions about their implementation if anyone is interested in writing their own.

EDIT: Using the template modification system removes the need for any manual template edits. Templates technically get version controlled through the XML file, but I understand it's a bit lackluster.

I've thought about adding to my development scripts to sync templates to/from the file system, but mostly just so I can edit templates in a real text editor instead of using the web-based editor on the development copy.

One other thing that I haven't automated is bumping the add-on version number before exporting the XML, but I imagine it wouldn't be too difficult to do so.
 
Last edited:
I do something similar to @Jeremy P but a fair bit simpler.
I have a git repo that I dump all the addon files in, and then a python script which contains a dictionary definition for each addon file.
I run the script, it takes the addon, applies some processing, then dumps it in an output folder, which is also under git and diffed.

Example entries include:
Code:
  'dpSyntaxHighlighter': {
     'file': 'digitalpoint_syntaxhighlighter-130.zip',
     'upload': 'digitalpoint_syntaxhighlighter/upload',
     'xml': 'digitalpoint_syntaxhighlighter/addon-dpSyntaxHighlighter.xml',
     #####
     'patch': ['DigitalPointSyntaxHighlighter_invalid.patch', 'dpSyntaxHighlighter_yaml.patch']
   },
  'UI.X': {
     'file': 'audentio-ui_x-23_1-5-6-0.zip',
     'upload': 'Upload',
     'xml': 'style-UI.X.xml',
     #####
     'remove': ['style-UI.X.xml', 'js/audentio/ad_styler/2.1/stylesheets/styleit.css.old'],
     'copy': [('styles/default', 'styles/spigot'), ('styles/uix', 'styles/spigot')]
   },
 
Back
Top Bottom