https://github.com/eggjs/scripts
deploy tool for egg projects
https://github.com/eggjs/scripts
deployment egg
Last synced: 20 days ago
JSON representation
deploy tool for egg projects
- Host: GitHub
- URL: https://github.com/eggjs/scripts
- Owner: eggjs
- License: mit
- Created: 2017-02-10T03:49:19.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-12-31T13:33:02.000Z (4 months ago)
- Last Synced: 2025-04-02T06:11:18.669Z (27 days ago)
- Topics: deployment, egg
- Language: TypeScript
- Homepage:
- Size: 167 KB
- Stars: 119
- Watchers: 10
- Forks: 37
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @eggjs/scripts
[![NPM version][npm-image]][npm-url]
[](https://github.com/eggjs/scripts/actions/workflows/nodejs.yml)
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
[](https://nodejs.org/en/download/)
[](https://makeapullrequest.com)[npm-image]: https://img.shields.io/npm/v/@eggjs/scripts.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@eggjs/scripts
[codecov-image]: https://codecov.io/github/eggjs/scripts/coverage.svg?branch=master
[codecov-url]: https://codecov.io/github/eggjs/scripts?branch=master
[download-image]: https://img.shields.io/npm/dm/@eggjs/scripts.svg?style=flat-square
[download-url]: https://npmjs.org/package/@eggjs/scriptsdeploy tool for egg project.
**Note: Windows is partially supported, see [#22](https://github.com/eggjs/egg-scripts/pull/22)**
## Install
```bash
npm i @eggjs/scripts --save
```## Usage
Add `eggctl` to `package.json` scripts:
```json
{
"scripts": {
"start": "eggctl start --daemon",
"stop": "eggctl stop"
}
}
```Then run as:
- `npm start`
- `npm stop`**Note:** `egg-scripts` is not recommended to install global, you should install and use it as npm scripts.
## Command
### start
Start egg at prod mode.
```bash
$ eggctl start [options] [baseDir]# Usage
# eggctl start --port=7001
# eggctl start ./server
```- **Arguments**
- `baseDir` - directory of application, default to `process.cwd()`.
- **Options**
- `port` - listening port, default to `process.env.PORT`, if unset, egg will use `7001` as default.
- `title` - process title description, use for kill grep, default to `egg-server-${APP_NAME}`.
- `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, don't use it if in docker mode.
- `framework` - specify framework that can be absolute path or npm package, default to auto detect.
- `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.
- `ignore-stderr` - whether ignore stderr when app starts.
- `sourcemap` / `typescript` / `ts` - provides source map support for stack traces.
- `node` - customize node command path, default will find node from $PATH### stop
Stop egg gracefull.
**Note:** if exec without `--title`, it will kill all egg process.
```bash
$ eggctl stop [options]# Usage
# eggctl stop --title=example
```- **Options**
- `title` - process title description, use for kill grep.
- `timeout` - the maximum timeout when app stop, default to 5s.## Options in `package.json`
In addition to the command line specification, options can also be specified in `package.json`. However, the command line designation takes precedence.
```js
{
"eggScriptsConfig": {
"port": 1234,
"ignore-stderr": true,
// will pass as `node --max-http-header-size=20000`
"node-options--max-http-header-size": "20000",
// will pass as `node --allow-wasi`
"node-options--allow-wasi": true
}
}
```## Questions & Suggestions
Please open an issue [here](https://github.com/eggjs/egg/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc).
## License
[MIT](LICENSE)
## Contributors
[](https://github.com/eggjs/scripts/graphs/contributors)
Made with [contributors-img](https://contrib.rocks).