FOUR-8217: Automate Default Template Creations#4784
Merged
Conversation
…ker using a queue
…ssmaker into template-sync
FOUR-8392 Template Automation test
|
QA server was successfully deployed https://ci-d5fd13766f.eng.processmaker.net |
|
SonarQube Quality Gate |
|
QA server was successfully deployed https://ci-d5fd13766f.eng.processmaker.net |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Issue & Reproduction Steps
In the current workflow, updating or adding default templates on a server requires manual intervention, significantly impacting engineers' development time. This PR aims to address this issue by introducing an automated process for updating and creating default templates.
Solution
To achieve this, the following key changes have been implemented:
php artisan processmaker:sync-default-templates, which triggers theSyncDefaultTemplatesjob. This job retrieves the index.json data from the Process Templates Repo.--queueflag, allowing the job to run on a daily schedule at a random time. This ensures regular synchronization without manual intervention.How to Configure:
To successfully configure the automated default template synchronization, follow these steps:
.envfile for your project.DEFAULT_TEMPLATE_REPO=process-templatesSet the value for this variable as the name of the process-templates repository that contains the templates you want to
sync with your environment.
DEFAULT_TEMPLATE_BRANCH=developSet the value for this variable as the name of the branch in the process-templates repository that contains the desired
templates for your environment.
DEFAULT_TEMPLATE_CATEGORIES=allThis variable allows you to specify specific verticals (directories) in the process-templates repository to be synced with
your environment. By default, it is set to all, which means all directories in the develop branch will be synced.
To specify a single directory, set the value to the directory name. For example, to sync the 'banking' directory in the
process- templates repository, set
DEFAULT_TEMPLATE_CATEGORIES=bankingTo sync multiple directories, separate the names with a comma.
For example:
DEFAULT_TEMPLATE_CATEGORIES=banking,human-resources,financingphp artisan optimize:clearci:package-data-sources:template-sync
ci:deploy
How to Test
Test Case A: Remove seeded Template and Sync with GitHub
Test Case B: Fresh install
Related Tickets & Packages
Code Review Checklist