Build-release independant from database

QuackieMackie

Active member
This suggestion is being made to re ignite an old suggestion that had a lack of interest. https://xenforo.com/community/threa...without-needing-a-full-xf-environment.187253/



As the title suggests, I’d like to see the php cmd.php xf-addon:build-release Vendor/Addon command function independently of the XenForo database.

At the moment, this isn’t possible because xf-addon:build-release depends on xf-addon:export, which requires a live database connection to generate the _data directory.
This dependency makes it impossible to perform a full release build in environments where a database isn’t available.

Removing XenForo’s current database dependency when building a release would mean developers would be able to automate their workflows, for example:
- Automatically build and package add-ons in CI/CD systems (e.g., GitHub, GitLab) when changes are pushed or a release is tagged.

Proposed solution
There are a couple of approaches, I could think of:
  • Keep _data automatically up to date whenever add-on files change, so xf-addon:build-release can run without accessing the database.
  • Allow xf-addon:export to operate directly from add-on files and the existing _output directory, rather than requiring a live database, and generate _data from that.
 
Upvote 1
I'd also like this.

I have been tinkering with self hosting a Gitlab instance and trying to get a full XF env also hooked up to it to do exactly this, but haven't had the time to fully even figure it out and get it working with looking for a job.
 
I'd also like this.

I have been tinkering with self hosting a Gitlab instance and trying to get a full XF env also hooked up to it to do exactly this, but haven't had the time to fully even figure it out and get it working with looking for a job.
Self hosting GitLab should in theory make it a lot easier to do.

Whether it’s easy though is another matter. If you do end up getting it working I’d love to know what you ended up doing. :)
 
I don't think implementing this suggestion would be worth the effort (if possible at all):
  1. Many (most?) 3rd party Add-ons seem to be developed by individual developers who primarily do this on a hobbyist who often do not use CI but build directly from their development instance (maybe even without using version control at all)
  2. While not straight forward, it is already possible to use CI toolchains to build XenForo Add-ons, we've been doing this internally for years using PHP Censor pulling from a self-hosted GitLab instance (could also pull from GitHub, etc.).
    Using GitLab, GitHub (or basically any tool that uses docker images) runners is also possible, you just have to use a custom build image that already has a XenForo installed or first install XF before building the Add-on (takes a bit longer)
  3. XenForo 2.4 will support SQLite additionally to MySQL. Using SQLite the database will just be one additional file which significantly simplifies an automated build process
  4. There might be Add-on code (either from the Add-on that is bulding itself or from other Add-ons) that needs to run during build process.
    How should this be done if the Add-on isn't installed and has access to its data (in the database)?
 
Last edited:
Back
Top Bottom