def __save_compile_env(self, tenant, service, language, library, run_time, procfile): # 删除原有 compile env logger.debug("save tenant {0} compile service env {1}".format( tenant.tenant_name, service.service_cname)) compile_env_service.delete_service_compile_env(service) if not language: language = False check_dependency = { "language": language, "runtimes": run_time, "dependencies": library, "procfile": procfile } check_dependency_json = json.dumps(check_dependency) # 添加默认编译环境 user_dependency = compile_env_service.get_service_default_env_by_language( language) if check_dependency["runtimes"]: user_dependency["runtimes"] = "" if check_dependency["procfile"]: user_dependency["procfile"] = "" if check_dependency["dependencies"]: user_dependency["dependencies"] = {} user_dependency_json = json.dumps(user_dependency) compile_env_service.save_compile_env(service, language, check_dependency_json, user_dependency_json) return 200, "success"
def __save_compile_env(self, tenant, service, language, library, run_time, procfile): # 删除原有 compile env logger.debug("save tenant {0} compile service env {1}".format(tenant.tenant_name, service.service_cname)) compile_env_service.delete_service_compile_env(service) if not language: language = False check_dependency = { "language": language, "runtimes": run_time, "dependencies": library, "procfile": procfile } check_dependency_json = json.dumps(check_dependency) compile_env_service.save_compile_env(service, language, check_dependency_json, "") return 200, "success"
def __save_compile_env(self, tenant, service, language): # 删除原有 compile env logger.debug("save tenant {0} compile service env {1}".format( tenant.tenant_name, service.service_cname)) compile_env_service.delete_service_compile_env(service) if not language: language = False check_dependency = { "language": language, } check_dependency_json = json.dumps(check_dependency) # 添加默认编译环境 user_dependency = compile_env_service.get_service_default_env_by_language( language) user_dependency_json = json.dumps(user_dependency) compile_env_service.save_compile_env(service, language, check_dependency_json, user_dependency_json)