Code Monkey home page Code Monkey logo

egg-scripts's Introduction

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


atian25


popomore


fengmk2


dead-horse


XadillaX


hyj1991


killagu


BaffinLee


leoner


plusmancn


shuidian


zhennann


liyanlong

This project follows the git-contributor spec, auto updated at Tue Mar 08 2022 09:52:13 GMT+0800.

egg-scripts's People

Contributors

atian25 avatar baffinlee avatar dead-horse avatar fengmk2 avatar hyj1991 avatar killagu avatar leoner avatar liyanlong avatar mansonchor avatar plusmancn avatar popomore avatar semantic-release-bot avatar shuidian avatar wjaywjay avatar xadillax avatar zhennann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.