Detalhes do pacote

egg-scripts

eggjs102.8kMIT3.1.0

deploy tool for egg project

readme (leia-me)

egg-scripts

deploy tool for egg project.

Note: Windows is partially supported, see #22

Install

$ npm i egg-scripts --save

Usage

Add eggctl to package.json scripts:

{
  "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.

$ 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.

$ 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.

{
  "eggScriptsConfig": {
    "port": 1234,
    "ignore-stderr": true,
    // will pass as `node --max-http-header-size=20000`
    "node-options--max-http-header-size": "20000"
  }
}

Questions & Suggestions

Please open an issue here.

License

MIT

Contributors

Contributors

Made with contributors-img.

changelog (log de mudanças)

Changelog

3.1.0 (2024-12-10)

Features

3.0.1 (2024-05-11)

Bug Fixes

  • head 100 stderr when startup failed (#59) (7f2cecf)

3.0.0 (2024-02-19)

⚠ BREAKING CHANGES

  • drop Node.js 14 support

Features

  • support configure egg.revert in package.json (#58) (a294691)

2.17.0 / 2022-04-28

features

2.16.0 / 2022-03-27

features

2.15.3 / 2022-03-08

fixes

others

2.15.2 / 2021-11-17

fixes

others

2.15.1 / 2021-09-15

features

others

2.15.0 / 2021-09-13

features

2.14.0 / 2021-06-11

features

2.13.0 / 2020-02-25

features

2.12.0 / 2019-12-16

features

2.11.1 / 2019-10-10

fixes

  • [de61980] - fix: start command should exit after child process exit when no daemon mode (#39) (killa <killa123@126.com>)

others

2.11.0 / 2018-12-17

  • feat(stop): only sleep when master process exists (#34)
  • fix: stop process only if the title matches exactly (#35)

2.10.0 / 2018-10-10

fixes

others

2.9.1 / 2018-08-24

  • fix: replace command by args in ps (#29)

2.9.0 / 2018-08-23

features

others

2.8.1 / 2018-08-19

fixes

2.8.0 / 2018-08-10

others

  • [dac29f7] - refactor: add this.exit to instead of process.exit (#25) (Khaidi Chu <i@2333.moe>)

2.7.0 / 2018-08-10

features

others

  • [e07726c] - refactor: raw spawn call to instead of helper.spawn in start non-daemon mode (#23) (Khaidi Chu <i@2333.moe>)

2.6.0 / 2018-04-03

  • feat: provides source map support for stack traces (#19)

2.5.1 / 2018-02-06

  • chore: add description for ignore-stderr (#18)

2.5.0 / 2017-12-12

features

2.4.0 / 2017-11-30

features

others

2.3.0 / 2017-11-29

features

2.2.0 / 2017-11-22

features

2.1.1 / 2017-11-14

fixes

2.1.0 / 2017-10-16

features

2.0.0 / 2017-10-13

features

others

1.2.0 / 2017-09-11

features

others

1.1.2 / 2017-09-01

  • fix: should not pass undefined env (#6)
  • docs: fix stop typo (#5)

1.1.1 / 2017-08-29

  • fix: should set title correct (#3)

1.1.0 / 2017-08-16

  • feat: remove env default value (#2)

1.0.0 / 2017-08-02

  • feat: first implementation (#1)