2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-13 16:56:33 +00:00

[fix] [cleanup] bench-path

This commit is contained in:
Anand Doshi 2016-06-16 12:13:05 +05:30
parent 8ff5519959
commit 0c0144021b
2 changed files with 8 additions and 8 deletions

View File

@ -22,7 +22,7 @@ def setup_letsencrypt(site, bench_path):
return
create_config(site)
run_certbot_and_setup_ssl(site, bench_path)
run_certbot_and_setup_ssl(site, bench_path)
setup_crontab()
@ -38,7 +38,7 @@ def create_config(site):
def run_certbot_and_setup_ssl(site, bench_path):
service('nginx', 'stop')
get_certbot()
try:
exec_cmd("{path} --config /etc/letsencrypt/configs/{site}.cfg certonly".format(path=get_certbot_path(), site=site))
except CommandFailedError:
@ -48,10 +48,10 @@ def run_certbot_and_setup_ssl(site, bench_path):
ssl_path = "/etc/letsencrypt/live/{site}/".format(site=site)
ssl_config = { "ssl_certificate": os.path.join(ssl_path, "fullchain.pem"),
ssl_config = { "ssl_certificate": os.path.join(ssl_path, "fullchain.pem"),
"ssl_certificate_key": os.path.join(ssl_path, "privkey.pem") }
update_site_config(site, ssl_config, bench=bench_path)
update_site_config(site, ssl_config, bench_path=bench_path)
make_nginx_conf(bench_path)
service('nginx', 'start')
@ -77,7 +77,7 @@ def get_certbot():
create_dir_if_missing(certbot_path)
if not os.path.isfile(certbot_path):
urllib.urlretrieve ("https://dl.eff.org/certbot-auto", certbot_path)
urllib.urlretrieve ("https://dl.eff.org/certbot-auto", certbot_path)
os.chmod(certbot_path, 0744)

View File

@ -92,7 +92,7 @@ class TestBenchInit(unittest.TestCase):
self.new_site(site_name)
bench_path = os.path.join(self.benches_path, "test-bench")
bench.app.get_app("https://github.com/frappe/frappe-client", bench=bench_path)
bench.app.get_app("https://github.com/frappe/frappe-client", bench_path=bench_path)
self.assertTrue(os.path.exists(os.path.join(bench_path, "apps", "frappeclient")))
def test_install_app(self):
@ -122,12 +122,12 @@ class TestBenchInit(unittest.TestCase):
bench_path = os.path.join(self.benches_path, "test-bench")
app_path = os.path.join(bench_path, "apps", "frappe")
bench.app.switch_branch(branch="master", apps=["frappe"], bench=bench_path, check_upgrade=False)
bench.app.switch_branch(branch="master", apps=["frappe"], bench_path=bench_path, check_upgrade=False)
out = subprocess.check_output(['git', 'status'], cwd=app_path)
self.assertTrue("master" in out)
# bring it back to develop!
bench.app.switch_branch(branch="develop", apps=["frappe"], bench=bench_path, check_upgrade=False)
bench.app.switch_branch(branch="develop", apps=["frappe"], bench_path=bench_path, check_upgrade=False)
out = subprocess.check_output(['git', 'status'], cwd=app_path)
self.assertTrue("develop" in out)