frappe / bench

CLI to manage Multi-tenant deployments for Frappe apps
https://frappeframework.com/docs/user/en/bench
GNU General Public License v3.0
1.41k stars 1.21k forks source link

get-app to allow local file system copy #1496

Open varun-krishnamurthy opened 1 year ago

varun-krishnamurthy commented 1 year ago

Issue: Feature Request

Is your feature request related to a problem? Please describe. In a situation wherein I have the local copy of the app, I am not able to import this app into the bench env easily. Since the Even though the bench get-app primarily depends on git, it should continue to allow importing apps from local filesystem. Even the CI process will get benefited from this (since the code is already checked out by the pipeline)

Describe the solution you'd like

bench get-app allow file:// context path . When the context uri starts with file://, instead of git clone, system should copy the file from the provided location and continue the rest of the process.

Describe alternatives you've considered

Manually copy the files and run py commands that bench runs to import the app into the bench env. Use git to re-download the files

Additional context I think this feature was earlier available but its not working now.

628426 commented 2 months ago

Hi @varun-krishnamurthy did you find a good workaround? I have tried many things including editing sites/apps.json apps.txt and using symlinks in the apps directory and no luck.

varun-krishnamurthy commented 2 months ago

@628426, For the adding the app from local file system you can follow these steps :

  1. Copy the app to the apps directory
  2. Run the below commands from bench's root dir
    
    ./env/bin/python3 -m pip install -e ./apps/<appname>  #Ensures the reuquired python modules are registered 
    ls -1 /home/frappe/frappe-bench/apps > sites/apps.txt; #Ensures apps gets recognized by bench
    bench setup requirements && bench build  --production #Ensures bench has all python deps and assets are built```
628426 commented 2 months ago

@628426, For the adding the app from local file system you can follow these steps :

  1. Copy the app to the apps directory
  2. Run the below commands from bench's root dir
./env/bin/python3 -m pip install -e ./apps/<appname>  #Ensures the reuquired python modules are registered 
ls -1 /home/frappe/frappe-bench/apps > sites/apps.txt; #Ensures apps gets recognized by bench
bench setup requirements && bench build  --production #Ensures bench has all python deps and assets are built```

Thanks for your help @varun-krishnamurthy , I should add that the --soft-link option and a path in the format of /pathtorepo worked for me using the bench get-app command