Most Powerful Open Source ERP

How To Use Commit From ERP5

Document showing how to work with business templates using git from inside ERP5.
  • Last Update:2017-01-05
  • Version:001
  • Language:en

This document should show a user how to setup the ERP5Forge business template to be able to use git inside ERP5.

Table of Contents

Installing ERP5Forge

Start by installing the ERP5Forge business template (bt5). See How To Install Business Templates in case you don't know how to work with business templates.

ERP5 | Open Source ERP - Installing erp5_forge business template

To be able to connect from within ERP5 to the repository you'll first need to update your preferences. Navigate to your preferences:

My Favorites > Preferences

and locate the VCS tab which has been added when installing ERP5Forge.

ERP5 | Open Source ERP - Preferences VCS tab

Setting Preferences Working Copies

Working Copies needs to contain the location of your "git" repositories and is required to use git from within ERP5. To set this up go to the webrunner interface of the runner your current ERP5 instance is installed on.

SlapOS Webrunner | Main Interface

Open a terminal and navigate to your software folder

cd software

If you have more than one subfolder you need to find out which release is the one actually running zope.

SlapOS Webrunner | Terminal - Software Releases

To find the correct release, try entering:

ls -lrt ../instance/slappart1

Alternatively you can pick any service PID running on the services tab and grep it using ps -edf | grep 30426. The result should also point you to the correct software release.

SlapOS Webrunner | Terminal - Software Releases Used

Switch to the folder and check git is there.

[your_release]/parts/erp5/
git status

This will show the location of your erp5 git repository which you want to access from your instance. Change the directory back to where you came from and navigate to your instance erp5shared folder using:

../../../../instance/slappart6/srv/erp5shared/

Note there are two ways to enable git access from within ERP5. The generic way would be to clone the repository using:

git clone https://lab.nexedi.com/nexedi/erp5.git

You will have a fresh erp5 repository, can retrieve its path using pwd and store it in ERP5 Preference VCS tab. This approach does not rely on Webrunner, so it will work without using the Webrunner, too. The disadvantage is that your software-release will now no longer be aligned with your git repo and you have two repositories to maintain.

The alternative is to create a symlink which relies on the Webrunner's security permissions to access the software-release and work with the git repository there. To do this just symlink using:

ln -s ../../../../software/05efca5f49c49fc2f5d9008fd357a14f/parts/erp5/

Check the contents of the directory afterwards to make sure you have an erp5 folder as on the screenshot.

SlapOS Webrunner | Terminal - Software Releases Symlink

Create a second symlink to the Product/ERP5/bootstrap folder which also includes business templates.

SlapOS Webrunner | Terminal - Software Releases Symlink Bootstrap

The final step is to add the new locations created via symlink to your working copies field inside ERP5. As in the clone variant make sure you copy the full path by using pwd. Don't forget to point to the folder which contain the bt5s on the first symlink (as on the screenshot). Include your email address and save.

ERP5 | Open Source ERP - Screenshot Preferences VCS Working Copies

If this is a newly created BT5, don't forget to create a working copy. See How To Commit New Business Template

If you now navigate back to business templates and clone an existing template you should have the Git tab available to commit the changes you have made.

ERP5 | Open Source ERP - Screenshot Business Template Forge Git Tab

Working with the ERP5Forge bt5

Please refer to How To Use ERP5 Subversion for learning how to work with this buinesss template and commit your code to a repository.

Troubleshooting

If the Git tab does not show up, you can check any of the following:

Ensure Preference is activated

Make sure the preferences you are adding your VCS info is active. Check the action tab for example.

ERP5 | Open Source ERP - Screenshot Preferences Active Preference

Related Articles