def POST(self): """ this is the data from POST['data'] { u'category': u'7', u'version' : u'5.7', u'appName' : u'haozu', u'projectPath' : u'/var/www/here', u'mailContent' : u'hello world', u'projectId': u'4', u'isDebug': True, u'versionForPackage': u'5.0.1', u'dependencyArray': [ { u'sha1': u'90123', u'repoId': u'1', u'repoName': u'RTNetwork' }, { u'sha1': u'90123', u'repoId': u'2', u'repoName': u'RTApiProxy' } ] } """ postData = web.input() data = json.loads(urllib.unquote(postData['data'])); print data os.system("echo '0%' > " + data['projectPath']+"/progress.log") PackageModel.buildPackage(data) pass
def POST(self): postData = web.input() print "here is post, %s" % postData print "user is %s" % postData["user"] print "repo is %s" % postData["repo"] print "ref is %s" % postData["ref"] """ user is mobile repo is mobile/ios_AnjukeHD ref is master """ branchName = postData["ref"] repoInfo = postData["repo"].split("/") repoName = repoInfo[1] user = postData["user"] if user == "wadecong": print "user is wadecong, do nothing" return if "develop" not in branchName: print "this is not develop, do nothing" return configHelper = ConfigHelper().initWithBranchName(branchName) packageInfo = configHelper.getConfigData() if packageInfo["category"] == '0': return if packageInfo["category"] != '7' and packageInfo["category"] != '8': packageInfo["category"] = '7' packageInfo["mailContent"] = configHelper.getMailContent(packageInfo["projectPath"], repoName, branchName) print packageInfo PackageModel.buildPackage(packageInfo) print "notification building package" pass