MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / create

Method create

mod/project/nodejs/comMod.py:99–226  ·  view source on GitHub ↗

@name 创建项目 @param get: dict_obj {} nodejs项目: get.project_cwd string 项目路径 /www/wwwroot/my_project 必传 get.project_name string 项目名称 my_project 必传 get.project_type string 项目类型 nodejs/pm2/

(self, get)

Source from the content-addressed store, hash-verified

97
98 # 2024/7/11 下午4:26 创建项目
99 def create(self, get):
100 '''
101 @name 创建项目
102 @param get: dict_obj {}
103 nodejs项目:
104 get.project_cwd string 项目路径 /www/wwwroot/my_project 必传
105 get.project_name string 项目名称 my_project 必传
106 get.project_type string 项目类型 nodejs/pm2/general 必传
107 get.project_script string 启动脚本 start/dev/... 必传
108 get.run_user string 运行用户 www/root/... 必传
109 get.port string 端口 4001 非必传
110 get.env string 环境变量 key=value\nkey=value\n... 非必传
111 get.nodejs_version string node版本 v20.15.0 必传
112 get.pkg_manager string 包管理器 npm/yarn/pnpm/... 必传
113 get.not_install_pkg bool 是否安装依赖包 True/False 非必传
114 get.release_firewall bool 是否放行防火墙 True/False 非必传
115 get.is_power_on bool 是否开机启动 True/False 非必传
116 get.max_memory_limit int 最大内存限制 4096 非必传
117 get.bind_extranet bool 是否绑定外网 True/False 依赖于get.port 非必传
118 get.domains list 域名列表 ["www.bt.cn", "bt.cn", ...] 非必传
119 get.project_ps string 备注 ps 非必传
120 pm2项目:
121 get.project_type string 项目类型 nodejs/pm2/general 必传
122 get.project_name string 项目名称 my_project 必传
123 get.nodejs_version string node版本 v20.15.0 必传
124 get.project_file string 项目启动文件 /www/wwwroot/my_project/server.js 自定义添加时必传
125 get.project_cwd string 项目路径 /www/wwwroot/my_project 自定义添加时必传
126 get.cluster int 实例数量 1 必传,默认1
127 get.max_memory_limit int 最大内存限制 1024 必传,默认1024,mb
128 get.watch 自动重载 bool True/False 必传,默认False
129 get.pkg_manager string 包管理器 none/npm/yarn/pnpm/... 必传,默认none
130 get.not_install_pkg bool 是否安装依赖包 True/False 非必传
131 get.run_user string 运行用户 www/root/... 必传
132 get.config_file string 配置文件路径 /www/wwwroot/remix_app/ecosystem.config.cjs 配置文件方式添加时必传
133 get.config_body string 配置文件内容 非必传 可以单独传config_body,如果选了config_file,这里就是必传,也要传config_body
134 get.port string 端口 4001 非必传
135 get.release_firewall bool 是否放行防火墙 True/False 非必传
136 get.is_power_on bool 是否开机启动 True/False 非必传
137 get.bind_extranet bool 是否绑定外网 True/False 依赖于get.port 非必传
138 get.domains list 域名列表 ["www.bt.cn", "bt.cn", ...] 非必传
139 get.project_ps string 备注 ps 非必传
140 general项目:
141 get.project_type string 项目类型 nodejs/pm2/general 必传
142 get.project_name string 项目名称 my_project 必传
143 get.nodejs_version string node版本 v20.15.0 必传
144 get.project_file string 项目启动文件 /www/wwwroot/my_project/server.js 必传
145 get.project_cwd string 项目路径 /www/wwwroot/my_project 必传
146 get.project_args string 启动参数 --debug 非必传
147 get.env string 环境变量 key=value\nkey=value\n... 非必传
148 get.run_user string 运行用户 www/root/... 必传
149 get.port string 端口 4001 非必传
150 get.release_firewall bool 是否放行防火墙 True/False 非必传
151 get.is_power_on bool 是否开机启动 True/False 非必传
152 get.max_memory_limit int 最大内存限制 4096 非必传
153 get.bind_extranet bool 是否绑定外网 True/False 依赖于get.port 非必传
154 get.domains list 域名列表 ["www.bt.cn", "bt.cn", ...] 非必传
155 get.project_ps string 备注 ps 非必传
156 '''

Callers 4

create_scriptMethod · 0.45
create_taskMethod · 0.45
create_flow_templateMethod · 0.45

Calls 15

check_port_is_usedMethod · 0.95
normalize_domainFunction · 0.90
set_self_getMethod · 0.80
ws_err_exitMethod · 0.80
set_nodejs_binMethod · 0.80
set_nodejs_versionMethod · 0.80
set_managerMethod · 0.80
set_pack_cmdMethod · 0.80
set_project_modelMethod · 0.80
set_port_ruleMethod · 0.80
formatMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected