node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



This package contains set of scripts to receive queries from Bitbucket and trigger a tutum redeploy.

The following package contains 2 variants:

  • a server that can be built and run with docker: this server will restart other services
  • a server (bitbucket-listener.js) to be used inside an existing docker container. This server receive POST requests from bitbucket and calls a build script


The following object map the branch name and its URL to redeploy (see triggers in tutum service)

$ export BRANCHES='{"2klicdev/frontend_v2":{"develop":"", "master":""}, "2klicdev/api":{"master":"", "develop":""}}'


In Bitbucket, add a web hook that points to this service, ex:

How it works

After setting up the webhook, Bitbucket will send a POST to this service and this service will look at the branch of the commit. If the branch is defined in the environment variable, then it will redeploy the service. mv # Redeploy Script Use this script into docker to detect when a new commit was done. If the commit match to the repository and branch as defined in the environment variable, then redeploy the container

The bitbucket-listener.js is intended to be added to the dockerfile as follow:

$ RUN npm install git-auto-build

Then in a shell script that is called at the container startup, , assuming the code is into /opt/app, add the following command to start the redeploy service:

$ node /opt/app/bitbucket-listener.js