Custom App and Fixtures Management using repository(git) management

This is the first time I am successfully managing the custom app along with standard (ERPNext App) changes in doctypes using the git management Which i am sharing with you -

Steps to Setup the Custom APP and Fixtures (Custom Field & standard doctype changes) using the repository management –
1. Create the custom app
bench new-app app_name
Note - Replace your_app with a new name which should be the same as repository. Please ensure there are no spaces and no dashes
2.Add Fixtures –
a. Fixures – [‘doctye’,’fieldname’] - it should be in hooks.py
b. Run - bench --site site_name install-app app_name
c. Run - bench --site site_name migrate
3. Exports Fixtures –
a. Cd/home/frappe-bench
b. bench exports-fixtures
Now you should see the new folder in your app call fixtures
4. Push app to GitHub
Now we need to push the app to GitHub. Don’t forgot to change the user and password of git
a. cd /home/frappe-bench/apps/your_app
b. git config --global user.name “your github username”
c. git config --global user.email “Your GitHub email”
d. git config --global user.password “Your GitHub token”
c. git init
d. git remote add origin repository URL
e. git checkout -b master
f. git add .
g. git commit -m “changes message”
h. git push -f origin master
set the branch to remote branch for easy pull/push:
git branch --set-upstream-to=origin/master master

5. Updating App
a. Go to your app folder (cd /home/frappe-bench/apps/your_app)
b. Git pull origin branch_name
c. bench --site site_name migrate
6. Installing App from GitHub
a. got to your frappe-bench folder (cd /home/user/frappe-bench)
b. bench get-app your_reporsitory_url (https://github.com/GitHubUsername/you_app_name.git)
c. bench install-app your_app_anme
d. bench --site site_name migrate
7. Uninstalling/remove the custom_app from the ERPNext
a. bench –-site your_site_name uninstall-app your_app
b. bench remove-app your_app

12 Likes