Skip to content

codenautas/auto-deploy

Repository files navigation

auto-deploy

auto deploy github based project and others

designing version downloads linux coverage climate dependencies

language: English also available in: Spanish -

Use

Add launch line to package.json

{
  "scripts": {
    "auto-deploy": "auto-deploy-run server/server.js"
  }
}

Use the module in your server

var autoDeploy = require('auto-deploy');

app.use('/tools', autoDeploy.middleware({pid:12345}));

To log into a text file you can pass the filename as an argument to auto-deploy-run, for example:

{
  "scripts": {
    "auto-deploy": "auto-deploy-run -l server.log server/server.js"
  }
}

Then start the server with

npm run-script auto-deploy

Then run commands in the URL of the browser, for example:

http://theserver.zzz/tools/auto-deploy?restart

http://theserver.zzz/tools/auto-deploy?stop&pid=3344

main goal

To have the possibility to specify in the address bar of the browser the need to install a new version:

  • auto deploy by URL (GET request)
  • the server executes a stop (as clean as possible)
  • the server updates git pull or svn update, etc
  • the server installs the new version npm prune, npm install
  • the server executes npm start --production or similar command

possible improvements

  • the servers checks the local repository to ensure it's cleaness (to prevent conflicts with the git pull)
  • the possibility to register a function that checks the integrity and status of the server.
    • in the case where it's safe to shutdown the server, it returns an explanatory message and a random code to force. ie: force=4312
    • the force option executes the indicated action anyway.

License

MIT

................

About

auto deploy github based project and others

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published