rtCamp / Frappe-Manager

A CLI tool based on Docker Compose to easily manage Frappe based projects.
MIT License
116 stars 24 forks source link

fm create version passing simplification #29

Open rahul286 opened 1 year ago

rahul286 commented 1 year ago
fm create erp --frappe-branch version-15-beta --apps erpnext:version-15-beta --apps hrms:version-15-beta

I think by default hrms, erpnext and other apps better be on same frappe branch version.

So when we use shorthand syntax:

fm create erp --frappe-branch version-15-beta --apps erpnext --apps hrms

version-15-beta should be implied for apps, as in the above example.

Can we further simplify by making apps comma separated?

fm create erp --frappe-branch version-15-beta --apps erpnext, hrms

A step ahead, we can also simplify version passing

fm create erp --version 15 --apps erpnext, hrms

or

fm create erp -v 15 --apps erpnext, hrms
Xieyt commented 1 year ago

@rahul286 Since fm supports all the frappeverse apps, in the whole frappeverse apps only frappe,erpnext,hrms follows branch name convention like version-14 or version-15-beta. Other apps like helpdesk,insights doesn't follow this naming convention then how should fm handle this case ?

fm create erp --version 15 --apps erpnext, hrms

We can't implement this as bench get-app <app-name> works on the basis of branch names. Suppose we are defining the version 15 that will match with many branches and selecting one for installing might become a hard task, I think if user provides branch name will make more sense.

Screenshot 2023-09-18 at 8 44 19 PM
rahul286 commented 1 year ago

Can we have some kind of aliases?

For apps which support stable and dev releases

  1. by default latest stable version is installed.
  2. if --dev flag is passed, dev version is installed.

For apps which support only one, such flag can be ignored by printing warning and install latest.

Let me know if you see any issue. Please confirm before moving ahead.

Xieyt commented 1 year ago

I can go ahead with this, I will create dictionary with hard corded values of apps with respective branch name and utilize that to get branch names when specific flag --stable or --dev will be passed.

For example:

stable = { 'frappe' : 'version-14', 'erpnext': 'version-14' ....  }
dev = { 'frappe' : 'develop', 'erpnext' : 'develop' ....}

But I am concerned about branches like `version-15-beta', which is neither develop nor stable.

I have another Idea like creating a stack system which will have good defaults like this

  1. erpstack-15 -> which will have frappe:version-15-beta, erpnext:version-15-beta, hrms:version-15-beta
  2. erpstack-14 -> which will have frappe:version-14, erpnext:version-14, hrms:version-14
  3. erpstack-dev -> which will have frappe:develop, erpnext:develop, hrms:develop

This stacks will be stored in a yaml/toml file. Using this file user can add custom stack that they frequently use if they want.

If user wants to add more apps or want to use other branch for specific stack app then they can use flag --apps <app>:<branch>, the apps given using flag will have more priority then defined in stack system.

For this system I can expose one flag like --install-stack <stackname> in the fm create command.

What do you think about this idea ?

NagariaHussain commented 10 months ago

I have another Idea like creating a stack system which will have good defaults like this

  1. erpstack-15 -> which will have frappe:version-15-beta, erpnext:version-15-beta, hrms:version-15-beta
  2. erpstack-14 -> which will have frappe:version-14, erpnext:version-14, hrms:version-14
  3. erpstack-dev -> which will have frappe:develop, erpnext:develop, hrms:develop

This stacks will be stored in a yaml/toml file. Using this file user can add custom stack that they frequently use if they want.

If user wants to add more apps or want to use other branch for specific stack app then they can use flag --apps <app>:<branch>, the apps given using flag will have more priority then defined in stack system.

For this system I can expose one flag like --install-stack <stackname> in the fm create command.

IMO this is a very good idea! This will let users create and share stacks easily. For example, FrappeHR can have erpnext, hrms . Some "frappeverse" playground stack can have essentials like insights, gameplan, drive, etc. already defined.

I can see this becoming really useful!