def deployRecycle(request): data = request.POST.getlist('id') site, env = data[0].split(',') username = request.user ip = request.META['REMOTE_ADDR'] fileName = '/tmp/deployRecycle_' + getNowTime() deploy = deployWwwRecycle.delay(env, site, username, ip, fileName, request.POST['phone_number']) if deploy.id: return render(request, 'getText.html', {'fileName': fileName}) else: return HttpResponse('celery error!')
def deployIis(request): env = request.POST['env'] site = request.POST['project'] username = request.user ip = request.META['REMOTE_ADDR'] fileName = '/tmp/deployIis_' + getNowTime() deploy = deployWww.delay(env, site, username, ip, fileName, request.POST['phone_number']) if deploy.id: return render(request, 'getText.html', {'fileName': fileName}) else: return HttpResponse('celery error!')
def deployGroup(request): env = '1' group = request.POST['group_name'] print '----group----', group username = request.user ip = request.META['REMOTE_ADDR'] fileName = '/tmp/deployGroup_' + getNowTime() deploy = deployWwwGroup.delay(env, group, username, ip, fileName, request.POST['phone_number']) if deploy.id: return render(request, 'getText.html', {'fileName': fileName}) else: return HttpResponse('celery error!')
def build_go(request): username = request.user ip = request.META['REMOTE_ADDR'] env = request.GET['env'] hostname = request.GET['hostname'] project = request.GET['project'] supervisorName = request.GET['supervisorname'] goCommand = request.GET['command'] svnRepo = request.GET['svnrepo'] svnUsername = request.GET['svnusername'] svnPassword = request.GET['svnpassword'] fileName = '/tmp/build_go_' + getNowTime() deploy = deploy_go.delay(env,hostname,project,supervisorName,goCommand,svnRepo,svnUsername,svnPassword,fileName,username,ip) if deploy.id: return render(request,'getText.html',{'fileName':fileName}) else: return HttpResponse('celery error!')