Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ $ npm i egg-scripts --save

## Usage

Add `egg-scripts` to `package.json` scripts:
Add `eggctl` to `package.json` scripts:

```json
{
"scripts": {
"start": "egg-scripts start --daemon",
"stop": "egg-scripts stop"
"start": "eggctl start --daemon",
"stop": "eggctl stop"
}
}
```
Expand All @@ -36,10 +36,10 @@ Then run as:
Start egg at prod mode.

```bash
$ egg-scripts start [options] [baseDir]
$ eggctl start [options] [baseDir]
# Usage
# egg-scripts start --port=7001
# egg-scripts start ./server
# eggctl start --port=7001
# eggctl start ./server
```

- **Arguments**
Expand All @@ -50,16 +50,19 @@ $ egg-scripts start [options] [baseDir]
- `workers` - numbers of app workers, default to `process.env.EGG_WORKERS`, if unset, egg will use `os.cpus().length` as default.
- `daemon` - whether run at background daemon mode.
- `framework` - specify framework that can be absolute path or npm package, default to auto detect.
- `env` - egg server env, default to `process.env.EGG_SERVER_ENV`, recommended to keep empty then use framwork default env.
- `env` - server env, default to `process.env.EGG_SERVER_ENV`, recommended to keep empty then use framwork default env.
- `stdout` - customize stdout file, default to `$HOME/logs/master-stdout.log`.
- `stderr` - customize stderr file, default to `$HOME/logs/master-stderr.log`.
- `timeout` - the maximum timeout when app starts, default to 300s.

### stop

Stop egg gracefull.

```bash
# stop egg
$ egg-scripts stop [baseDir]
# egg-scripts stop ./server
$ eggctl stop [baseDir]
# eggctl stop ./server
```

- **Arguments**
Expand Down
6 changes: 3 additions & 3 deletions lib/cmd/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ class StartCommand extends Command {
type: 'boolean',
},
stdout: {
description: 'A file that stdout redirect to',
description: 'customize stdout file',
type: 'string',
},
stderr: {
description: 'A file that stderr redirect to',
description: 'customize stderr file',
type: 'string',
},
timeout: {
description: 'a timeout for start when daemon',
description: 'the maximum timeout when app starts',
type: 'number',
default: 300 * 1000,
},
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "deploy tool for egg project",
"main": "index.js",
"bin": {
"egg-scripts": "bin/egg-scripts.js"
"egg-scripts": "bin/egg-scripts.js",
"eggctl": "bin/egg-scripts.js"
},
"dependencies": {
"common-bin": "^2.7.1",
Expand Down