bench icon indicating copy to clipboard operation
bench copied to clipboard

get-app to allow local file system copy

Open varun-krishnamurthy opened this issue 2 years ago • 3 comments

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.

varun-krishnamurthy avatar Nov 08 '23 00:11 varun-krishnamurthy

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.

628426 avatar Aug 17 '24 07:08 628426

@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```

varun-krishnamurthy avatar Aug 20 '24 06:08 varun-krishnamurthy

@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

628426 avatar Aug 20 '24 18:08 628426