Packages Tutorial

Basics

Zammad contains the functionality to install and remove packages. You can find the package manager in the admin interface:

Admin → Packages

To install a package, you will need a package build:

A *.zpm

ZPM stands for Zammad Package Module. It can be selected and installed. Afterwards in the top there will be list of commands which the normal administrator wants to execute.

root> zammad config:set BUNDLE_DEPLOYMENT=0
root> zammad run bundle config set --local deployment 'false'

These commands will allow package installations to handle custom gem files. In zammad it is also possible to inject your own gem files to include own libraries for your custom development.
To introduce your own gem files, you need to create them with the following naming: Gemfile.local.ExampleTestPackage. All Gemfile.local* will be included into the bundle install.

root> zammad run bundle install

If your package contains a local gem file, then the 3 upper commands will be shown in the admin interface. This command is needed to install gems of zammad and also of your custom developments.

root> zammad run rake zammad:package:migrate

This command will run all specific package migrations. They are handled over a non-rails zammad specific code, which will save executed package migrations and run them only once per install and once per removal of the package.

root> zammad run rake assets:precompile

This command will compile all assets for zammad. You want to run this command always if you have installed a new package with frontend files like *.js, *.coffee, *.jst.eco or *.css.

root> zammad run rake zammad:package:post_install

With never systems you will only see this command left. It is a coombination of the previous commands and will run the commands which are needed. It simplifies package installations and also provides the foundation for the new tech stack which includes new commands. Since this tutorial is focused on the old tech stack, we will leave it with that for now (zammad/lib/tasks/zammad/package/post_install.rb at c81e7ad5a99b76bc76175731c710e298092db218 · zammad/zammad · GitHub).

root> systemctl restart zammad

This commands obviously restarts zammad. Changes of your ruby files will get activated after the restart.

2 Likes