Exemplo n.º 1
0
 def get_urls(self):
     setting_files = utils.search_file(BaseDeployer.TMP_DEPLOY_PATH, 'settings.py')[0]
     dirname = os.path.dirname(setting_files)
     sys.path.append(dirname)
     proj_name = os.path.basename(setting_files)
     command = "python " + utils.to_vm_path('get_urls.py') + ' ' + utils.to_vm_path(dirname) + ' ' + proj_name
     out = utils.vagrant_run_command(command).strip()
     if not out:
         urls = []
     else:
         urls = out.splitlines()
     return urls
Exemplo n.º 2
0
 def runServer(self, path):
     LOG.info("Run server...")
     vm_manage_file = utils.to_vm_path(path)
     command = utils.vagrant_cd(os.path.dirname(path)) + " && " + \
               "nohup python manage.py runserver 0.0.0.0:8000 & sleep 1"
     return utils.vagrant_run_command(command)