Minimalist nodejs server for automatic deployment
npm install stunt-deployer-serversh
npm install --global stunt-deployer-server
`Usage
`sh
stunt-deployer-server [--hooks ] [--port ]
`
Default port: 3000Configuring deployment hooks
All deployment hoos are defined in hooks.json file.
`json
{
"unique-hook-name": {
"cwd": "./path-to-deploy-script",
"exec": "bash deploy.sh"
}
}
`
Hitting http://example.com:3000/unique-hook-name will trigger deployment script.Run deployer server as a service
First create /etc/systemd/system/stunt-deployer-server.service
`
[Unit]
Description=StuntCoders Deployment Server[Service]
WorkingDirectory=/root/stunt_deployer/
ExecStart=/usr/local/bin/stunt-deployer-server --hooks /root/stunt_deployer/hooks.json
Restart=always
[Install]
WantedBy=multi-user.target
`Then start the service
`
systemctl daemon-reload
systemctl enable stunt-deployer-server
systemctl start stunt-deployer-server
``