1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using Xenforo with 3 stage development environment

Discussion in 'XenForo Pre-Sales Questions' started by magnusman, May 27, 2016.

  1. magnusman

    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?

    Last edited: May 27, 2016
  2. Liam W

    Liam W Well-Known Member

    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.

  3. tyteen4a03

    tyteen4a03 Well-Known Member

    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.
  4. magnusman

    magnusman New Member

    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:

  5. tyteen4a03

    tyteen4a03 Well-Known Member

    For b), shouldn't an addon upgrade cover that already?
    Xon likes this.
  6. nopoles

    nopoles Member

    @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.
  7. Xon

    Xon Well-Known Member

    I manually bundle the zip up, and then use that to deploy using this version of @Chris D's add-on installer.

    I just haven't had the time to fix the UI issues and get it released.
  8. nopoles

    nopoles Member

    Thanks, I'll check it out.
    Xon likes this.
  9. magnusman

    magnusman New Member

    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.
    Xon likes this.
  10. Jeremy P

    Jeremy P Well-Known Member

    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: Jun 11, 2016
    Xon likes this.
  11. md_5

    md_5 Well-Known Member

    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:
      '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')]

Share This Page