def app(request, app_id=None): app = App.objects.get(id=app_id) config = _get_config(app.wd) git_info = { 'head': git.head(wd=app.wd), 'remote': git.remote_url(wd=app.wd), 'branch': git.branch(wd=app.wd) } deploys = Deploy.objects.filter(app=app).order_by('-created')[:5] c = {'app': app, 'git': git_info, 'deploys': deploys} c.update(csrf(request)) return render_to_response("app.html", c)
def app(request, app_id=None): app = App.objects.get(id=app_id) app.load_config() envs = [] if ("envs" in app.config): for label, env_data in app.config['envs'].iteritems(): env_data['label'] = label env.host_string = env_data['host'] host = env_data['host'] if '@' in host: host = host.split('@')[1] env.key_filename = dsettings.SSH_KEY_DIR + '/deploy_rsa' env.no_keys = True env.user = '******' print env with cd(env_data['working_dir']): print run('pwd') git_info = { 'head': git.head().rstrip(), 'remote': git.remote_url().rstrip(), 'branch': git.branch().rstrip(), } env_data['git'] = git_info envs.append(env_data) deploys = Deploy.objects.filter(app=app).order_by('-created')[:5] c = { 'app': app, 'envs': envs, 'git': {}, 'deploys': deploys, } c.update(csrf(request)) return render_to_response("app.html", c, context_instance=RequestContext(request))
def app(request, app_id=None): app = App.objects.get(id=app_id) config = _get_config(app.wd) git_info = { 'head': git.head(wd=app.wd), 'remote': git.remote_url(wd=app.wd), 'branch': git.branch(wd=app.wd) } deploys = Deploy.objects.filter(app=app).order_by('-created')[:5] c = { 'app': app, 'git': git_info, 'deploys': deploys } c.update(csrf(request)) return render_to_response("app.html", c)