doc/developer_manual/development_environment/development-workflow.md
This guide provides reference for the main tasks, scripts, and commands used when developing Zammad.
Zammad provides several Rake tasks to streamline development and setup.
rails zammad:bootstrap:reset - Quickly reset an existing development databaserails db:drop zammad:db:init – Reset an existing development database (without running auto_wizard)rails zammad:bootstrap:init – Initializes Database: only run on environment where DB was never setrails db:migrate – Run any pending Rails migrations[!Tip]
rails zammad:bootstrap:resetis pretty handy when you quickly want to restart fresh without rebuilding the containerOne command in few seconds vs multiple clicks around your Docker stack.
It's much faster then rebuilding, but essentially does the same thing.
rails zammad:bootstrap:reset:
auto_wizard so rails zammad:setup:auto_wizard is not needed afterwarddevcontainer[!Caution]
rails zammad:bootstrap:initis mostly not needed fordevelopment.
Use rails zammad:bootstrap:init only if you are intending to initialize a
previously uninitialized environment like for example production
or run on a fresh install.
rails zammad:package:migrate – Run any pending package migrationsrails zammad:setup:auto_wizard – Setup system from an auto_wizard definitionrails zammad:searchindex:rebuild – Full re-creation of all search indexes and re-indexing of all datarails generate zammad:translation_catalog – Regenerate the translation catalograils generate zammad:translation_catalog --full – Update template files from translationsrails zammad:translations:sync – Synchronize latest translations from i18n/*.po to the databaseZammad includes scripts to streamline common tasks.
(cd public/assets/images && pnpm install --frozen-lockfile && pnpm exec gulp build) - Regenerate icon assetspnpm generate-graphql-api - Regenerate GraphQL introspection filepnpm generate-setting-types - Regenerate Zammad setting typespnpm generate:install - Setup code generation toolspnpm generate:generic-component - Generate generic componentpnpm generate:composable - Generate generic composablepnpm generate:store - Generate generic storeRun tests frequently to verify your changes and avoid regressions.
Before running tests for the first time, prepare the test database and compile assets:
Further testing:
Linting ensures consistent code style and readability. They are optional but recommended:
These tools are included in the devcontainer; for manual setups you may want to install them to ensure consistent code style.
Some tasks can be executed directly via Rails console or rails r:
cat filename.eml | rails r 'Channel::Driver::MailStdin.new' - Import an email message as a ticketrails r 'Channel.last.update!(active: true)' - Enable dummy email channel (i.e. from auto_wizard)rails r "Setting.set('es_url', 'http://elasticsearch:9200')" - Configure Elasticsearch hostrails r "Setting.set('core_workflow_ajax_mode', true)" - Enable Core Workflow AJAX moderails r "Setting.set('ui_desktop_beta_switch', true)" - Enable Desktop View BETA UI togglerails c 'Package.link(%q!/path/to/package/checkout!)' - Link a packagerails c 'Package.unlink(%q!/path/to/package!)' - Unlink a packageFor further information see:
Learn more about developing and contributing to Zammad: