Using source control systems like Git for Ignition projects enables collaboration, version tracking, and safe deployments. Adopting best practices ensures efficient management of changes.
-
Organize Projects in Source Control
- Store each Ignition project in its own repository for clarity and isolation.
- Use a descriptive repository name, such as
production-monitoring-system
.
-
Branch Management
- Use three main branches:
main
(ormaster
): Stable, production-ready code.testing
: For quality assurance and testing changes.development
: Active development work.
- Create feature branches for new work and merge them back to
development
once completed.
- Use three main branches:
-
Track Ignition Resources
- Include:
- Gateway backups (.gwbk).
- Tags exported as JSON.
- Project files (e.g., Perspective Views, Vision Windows).
- Scripts and libraries.
- Avoid committing dynamically generated or temporary files like
.resources
.
- Include:
-
Automate Commits
- Use Gateway Event scripts to automatically commit changes when saving in the Ignition Designer.
-
Commit Regularly
- Make small, atomic commits with descriptive messages.
- Example:
git commit -m "Added new chart to production dashboard"
.
-
Pull Requests
- Use pull requests to review code before merging into
testing
ormain
branches. - Assign reviewers and include testing notes.
- Use pull requests to review code before merging into
-
Conflict Resolution
- Communicate with team members to resolve merge conflicts promptly.
- Test resolved changes thoroughly.
-
Documentation
- Include clear README files and comments within scripts to describe functionality.
-
Git Hooks
- Use pre-commit hooks to enforce coding standards and validate JSON/tag files.
-
Continuous Integration/Continuous Deployment (CI/CD)
- Set up pipelines to automatically test, build, and deploy projects.
- Example: Run automated tests on feature branches before merging.
-
Backup Strategy
- Regularly back up repositories to an external location.
- Include database and Gateway backups for complete recovery.
Feel free to contribute additional tips or corrections by submitting a pull request!