[RFC] egg-scripts proposals
See original GitHub issuehttps://github.com/eggjs/egg/issues/241 太长了,重开一个,讨论第一期的实现方案。
仅提供 egg-scripts start
和 egg-scripts stop
几条最基础的线上指令。
而看了下原内网的实现,会比较依赖于环境变量,本方案更倾向于用 cli options 的方式
原提案点击此处, 以下正文更新为讨论后的:
start
$ egg-scripts start [baseDir] --port=7001 --env=prod --workers=2 --no-daemon
description :
- master 进程上提供
egg-server
之类的关键词,用于 grep
** arguments: **
baseDir
为应用的根目录,可选,默认为process.cwd()
,支持相对路径
options :
port
为端口,可选,默认为 7001,不做冲突自动更换端口。env
为运行环境,可选,默认为prod
大小写不敏感,内部会统一转换为小写- 环境变量取值顺序 env 传值 -> EGG_SERVER_ENV 环境变量 -> 默认值 prod
workers
配置 workers 个数no-daemon
配置该参数则在前台运行framework
框架名,一般不需要填,自动检测title
关键词,用于 grep,默认为egg-server-APPNAME
stop
$ egg-scripts stop [baseDir]
description :
- 找到指定目录下的 egg master 进程,并 kill 掉
- 在 5s 后,寻找没有被 egg master 优雅退出的 worker/agent 进程,
kill -9
(虽然 egg-cluster 已经有处理了)
arguments :
baseDir
为应用的根目录,可选,默认为process.cwd()
Issue Analytics
- State:
- Created 7 years ago
- Comments:41 (41 by maintainers)
Top Results From Across the Web
Proposal for a staged RFC process - Baby Steps
This proposal represents an alternate take on the RFC process, drawing on some ideas from the TC39 process, but adapting them to Rust's ......
Read more >egg-scripts - npm
Start using egg-scripts in your project by running `npm i egg-scripts`. There are 130 other projects in the npm registry using egg-scripts.
Read more >Dependencies | beidou-example-with-react-loadable | npm
arrow_right babel‑eslint. 8.2.6 Notes Relation Licenses Dep...
Version 8.2.6 Published Description
arrow_right babel‑plugin‑dynamic‑import‑node. 1.2.0 Notes Relation Licenses Dep...
Version 1.2.0 Published Description
Read more >History.md · Gitee 极速下载/eggjs - Gitee.com
add lifecycle doc; add sequelize guide; add allowDebugAtProd in document; egg-scripts support windows; schedule add env description; more document and ...
Read more >2014-August.txt - Python mailing list
... in this document are to be interpreted as described in RFC 2119. ... [Distutils] windows permissions on bdist egg scripts, data?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
TERM 必然是进程退出了,要不然都不加stop了。真的不要做这么复杂,这里只做2件事情。其它都不是它负责的。
cluster兼容没必要做,有workers参数足够了
加一个
start-test: "egg-scripts start --env=test"