Bench copy and paste? is there is away?

i do lot of testing , and changes in frappe erpnext my custom apps in developer mode all day …
when things break down … i spend a lot of time to fix them to retest again , or i use bench init
bench get-app erpnext for example which also make me spend a lot of time too .!!
i wonder if there is a way to take a stable bench image and instead of create new benchs i just use this image and only make new-site and run , ??

Try bench init --clone-from /path/to/old/bench

See help:

➜  frappe-bench bench init --help
Usage: bench init [OPTIONS] PATH

  Create a new bench

  --apps_path TEXT      path to json files with apps to install after init
  --frappe-path TEXT    path to frappe repo
  --frappe-branch TEXT  path to frappe repo
  --clone-from TEXT     copy repos from path
  --no-procfile         Pull changes in all the apps in bench
  --no-backups          Run migrations for all sites in the bench
  --no-auto-update      Build JS and CSS artifacts for the bench
  --verbose             Verbose output during install
  --help                Show this message and exit.
1 Like

ahmad@ahmad-GE60-2PC:~/benches-workspace$ bench init portaltes --clone-from /home/benches-workspace/testing-benchs/portaltes/
INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
INFO:bench.utils:./env/bin/pip -q install --upgrade pip
INFO:bench.utils:./env/bin/pip -q install wheel
INFO:bench.utils:./env/bin/pip -q install six
INFO:bench.utils:./env/bin/pip -q install -e git+
Copying apps from /home/benches-workspace/testing-benchs/portaltes/…
cp: cannot stat ‘/home/benches-workspace/testing-benchs/portaltes/apps’: No such file or directory
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/ahmad/.bench/bench/”, line 40, in cli
File “/usr/local/lib/python2.7/dist-packages/click/”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/ahmad/.bench/bench/commands/”, line 19, in init
verbose=verbose, clone_from=clone_from)
File “/home/ahmad/.bench/bench/”, line 51, in init
clone_apps_from(bench_path=path, clone_from=clone_from)
File “/home/ahmad/.bench/bench/”, line 80, in clone_apps_from
subprocess.check_output([‘cp’, ‘-R’, os.path.join(clone_from, ‘apps’), bench_path])
File “/usr/lib/python2.7/”, line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command ‘[‘cp’, ‘-R’, u’/home/benches-workspace/testing-benchs/portaltes/apps’, u’portaltes’]’ returned non-zero exit status 1