def deploy_django(folder_info, site_info, version): # virtualenv mkvirtualenv(folder_info.install_venv()) # download and extract main package download_package( site_info.package, site_info.prefix(), version, folder_info.install_temp(), folder_info.install_venv() ) extract_project_package( folder_info.install(), folder_info.install_temp(), site_info.package, site_info.prefix(), version ) # debug run('ls -l {0}'.format(folder_info.install())) # requirements install_requirements( site_info.prefix(), folder_info.install(), folder_info.install_venv() ) command = DjangoCommand( folder_info.install(), folder_info.install_venv(), site_info ) command.collect_static() command.compress() # migrate database and init project if site_info.has_database: command.migrate_database() command.init_project()
def reindex(): """ For docs, see https://github.com/pkimber/cloud_docs """ env.user = '******' print(green("Haystack - reindex: '{}' on '{}' ").format( env.site_name, env.hosts )) folder_info = FolderInfo(env.site_info) command = DjangoCommand( folder_info.live(), folder_info.live_venv(), env.site_info ) command.haystack_index()
def haystack_index_clear(prefix, name): """ e.g: fab -H [email protected] haystack_index:prefix=pkimber,name=csw_web """ print(green("Haystack - reindex: '{}' on '{}' ").format( name, env.host_string) ) confirm = '' while confirm not in ('Y', 'N'): confirm = prompt("Are you sure you want to clear the Haystack index (Y/N)?") confirm = confirm.strip().upper() if not confirm == 'Y': abort("exit") folder_info = FolderInfo(name) command = DjangoCommand( folder_info.live(), folder_info.live_venv(), env.site_info ) command.haystack_index_clear()