Giter Site home page Giter Site logo

node-cd's Introduction

node-cd

Featherweight Github/Bitbucket/Contentful Continuous Deployment

Continuously deploy any code from Github/Bitbucket/Contentful to your server.

node-cd is a simple node.js app handling Github's, Bitbucket's and Contentful's post-receive hooks. It can execute any script you want on your server: deployment, testing, etc.

Requirements

node > 4

See https://github.com/A21z/node-cd/tree/v1.0.0 for node 0.x

Installation (master)

git clone https://github.com/A21z/node-cd.git
npm install

Installation (stable v2.0.0)

wget https://github.com/A21z/node-cd/archive/v2.0.0.tar.gz
tar xf v2.0.0.tar.gz
cd node-cd-2.0.0
npm install

Usage

  • Edit the bitbucket.sh, contentful.sh or github.sh file to execute whatever you like after your commits (ex: stop server, git pull, start server)
  • For GitHub: Set your post-receive hook as described here with the url http://yourserver.com:61440/github
  • For Bitbucket: Set your post-receive hook as described here with the url http://yourserver.com:61440/bitbucket
  • For Contentful: Set your webhook in your Settings > Webhooks with the url http://yourserver.com:61440/contentful
  • Add execution permission on scripts chmod +x bitbucket.sh contentful.sh github.sh
  • Run the app WWW_PORT=61440 node src/index.js

Build Status

node-cd's People

Contributors

a21z avatar georules avatar guanbo avatar humni avatar signorekai avatar zdwolfe 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-cd's Issues

Payload undefined

Nice idea for a module, very useful -

however currently getting 'payload undefined' on the console, and a 403 response on GitHub

Support X-Real-IP from nginx proxy?

Basically, my NodeJS apps pulling from Github are behind an nginx proxy, and the NodeJS server has no direct internet access. Therefore, the IP the request comes from is always an internal IP. Nginx then re-writes the original IP as "X-Real-IP". Can you provide a configuration option that enables checking X-Real-IP? Wouldn't always want that as then a public-facing NodeJS server could be impacted by somebody just writing in an "X-Real-IP" header as nginx wouldn't be handling that.

Seems to hang, no output

After a push request is sent, I get a 200 response with no body, and in the terminal I see the request output and POST /github 200 14ms, but nothing after that till I hit ctrl+c.

TypeError: Cannot read property 'changes' of undefined

Hi,

I get the following error, would be great if you can give me some pointers to look at to solve this problem.

Thanks a million!

Node-cd server listening on port 61440
{"readable":false,"_maxListeners":10,"httpVersion":"1.1","complete":true,"_pendingIndex":0,"url":"/bitbucket","method":"POST","_consuming":true,"_dumped":false,"httpVersionMajor":1,"httpVersionMinor":1,"upgrade":false,"baseUrl":"","originalUrl":"/bitbucket","_remoteAddress":"104.192.143.193","_body":true}
104.192.143.193 - - [07/Mar/2016:19:02:13 +0000] "POST /bitbucket HTTP/1.1" 500 1385 "-" "Bitbucket.org"
TypeError: Cannot read property 'changes' of undefined
    at Bitbucket.post (/home/x/swaggerUI-h10/node-cd-2.0.0/src/routes/bitbucket.js:17:30)
    at Layer.handle [as handle_request] (/home/x/swaggerUI-h10/node-cd-2.0.0/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/x/swaggerUI-h10/node-cd-2.0.0/node_modules/express/lib/router/route.js:131:13)
    at Route.dispatch (/home/x/swaggerUI-h10/node-cd-2.0.0/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/x/swaggerUI-h10/node-cd-2.0.0/node_modules/express/lib/router/layer.js:95:5)
    at /home/x/swaggerUI-h10/node-cd-2.0.0/node_modules/express/lib/router/index.js:277:22
    at Function.process_params (/home/x/swaggerUI-h10/node-cd-2.0.0/node_modules/express/lib/router/index.js:330:12)
    at next (/home/x/swaggerUI-h10/node-cd-2.0.0/node_modules/express/lib/router/index.js:271:10)
    at serveStatic (/home/x/swaggerUI-h10/node-cd-2.0.0/node_modules/express/node_modules/serve-static/index.js:74:16)
    at Layer.handle [as handle_request] (/home/x/swaggerUI-h10/node-cd-2.0.0/node_modules/express/lib/router/layer.js:95:5)

Thanks for the module by the way, I checked the code and I really like it!!

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.