XF 2.2 Optimizing Forum Development with Git: Sharing Experiences and Best Practices

emiya

Member
Hello,

over the years, I've experimented with various development environments for my forum, but unfortunately, they have all been unsuccessful. For instance, I created a development site alongside my live site, where changes were made and then simply integrated into the live site. However, this approach was not particularly efficient and hindered the workflow. Now, I'd like to try a new approach using Git. My idea is to upload my forum to a Git repository, with the master branch representing the live site, and allowing all developers to work on it. Are there any of you who also work with Git? Could you share with me how you've implemented this? What does your setup look like? Did you upload the entire forum or just the "src/addon" folder? I would greatly appreciate any solutions you could provide.

Best regards
 
This very forum is distributed from our private development repo hosted on GitHub.

Although main is our active development target (2.3) and our live version (2.2) is in a branch named 2.2.x.

I can’t speak for what would work for others or in the context of developing specific add-ons but for us the entire software is hosted in GitHub - which also includes all of our add-ons, and we pull down changes periodically to roll out bug fixes and new versions.
 
Thank you for your response, @Chris D . It has already helped me a lot, but I still have a few questions:
1. Do you use a single database for everything or do you use separate ones?
2. How do you test the functionality of your updates? Do you pull the Dev. Repo locally?
 
We have a single development repo for XenForo and we all bring that down locally and work on it and those changes are pushed to the repo and then we pull them down here when those changes are to go live.

The downloadable builds that we release are built from the same development repo at release time.

We have a single database running for this forum and we as developers maintain our own databases for testing, occasionally bringing down a sanitised copy of the live database if we need some real world data to test on.
 
Hello,

over the years, I've experimented with various development environments for my forum, but unfortunately, they have all been unsuccessful. For instance, I created a development site alongside my live site, where changes were made and then simply integrated into the live site. However, this approach was not particularly efficient and hindered the workflow. Now, I'd like to try a new approach using Git. My idea is to upload my forum to a Git repository, with the master branch representing the live site, and allowing all developers to work on it. Are there any of you who also work with Git? Could you share with me how you've implemented this? What does your setup look like? Did you upload the entire forum or just the "src/addon" folder? I would greatly appreciate any solutions you could provide.

Best regards

It really depends on exactly what you are trying to track and why.

Ideally, most modifications should be done by way of addons - this keeps them self contained and modular and allows you to test them easily by simply deploying your addon to a test server. There are also plenty of tools provided by XF to automate the build and deployment process.

I maintain git repositories for each of the addons I develop.

So for example, my KnownBots addon is in the src/addons/Hampel/KnownBots directory and so this directory is what I add to git.

I then have a separate git repository for src/addons/Hampel/WhatsNewDigest, and so on for each of my addons.

For deployment, you can either use automated tools (I use DeployHQ) to push out updates from your hosted git repository (github or bitbucket) and have it run the install process as part of deployment - but I find it easier now to simply install the built zip file manually using the forum UI - it's very quick and less trouble prone than automated tools I've found. Automation would only be beneficial IMO, when deploying to many sites all at once.

For styles you can do similar using designer mode - https://xenforo.com/docs/dev/designing-styles/

You'd just add the [basePath]/[designer_mode_id] path to git and export/import as per the docs.
 
Back
Top Bottom