0.0.4 • Published 4 years ago

@arseniosiani/github-webhook-deployer v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

github-webhook-deployer

nodejs server based on expressjs to automate deploy using github webhooks

Intallation

	npm i github-webhook-deployer --save

Pre-requisites

You shound have a file called deploy.sh in the root directory of your github project. / The file should contain all mandatory commands to deploy your app in production. For example:

npm install
npm run build
mv dist /var/www/my_awesome_app

Usage

const  deployer  =  require('@arseniosiani/github-webhook-deployer');

deployer.on('start', function(repo_info){
    console.log("Started deploy for "+ repo_info.repository.name);
})

deployer.on('all_done', function(repo_name){
    console.log("Finished deploy for "+ repo_name);
})

deployer.listen(5000,'0.0.0.0')

Events

EventDescriptionParams
invokedEmitted on webhook invocationrepo_info: the whole data from webhook body
start_deployEmittend when the deploy process starsrepo_name: the repository name
start_cloneemitted when the git clone process startsrepo_name: the repository name
clone_doneemitted when the git clone process has finisedrepo_name: the repository name
start_deploy_scriptemitted when the ./deploy.sh process has firedrepo_name: the repository name
deploy_script_doneemitted when the ./deploy.sh process has dinishedrepo_name: the repository name
dataemitted when new output (stdin or stderr) is availabledata: the output of the script
all_doneemitted when everithing as gone wellrepo_name: the repository name
erroremitted when error occurriederr: the error object
0.0.4

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago