qwebs-bitbucket-deploy

0.2.18 • Public • Published

qwebs-auth-jwt

Qwebs webhook service to deploy from bitbucket.

Features

Override default behaviour

const BitbucketService = require("qwebs-bitbucket-deploy");
const process = require("process");
 
class MyBitbucketService extends BitbucketService {
  constructor() {
    super();
  };
 
  /* return boolean */
  startDeployement(comments) {
    return comments.reduce((previous, current) => {
      //find a comment like 'prod version 1.0.3'
      return previous || /prod version \d+.\d+.\d+/g.test(current);
    }, false);
  }
 
  restart() {
      //just stop the process
      //if we use pm2, the process will be automatically restarted
      process.exit(1);
  }
};
 
exports = module.exports = MyBitbucketService;

Declare and inject $auth

{
    "services": [
        { "name": "$bitbucket", "location": "./services/bitbucket" }
    ],
    "locators": [
        { "post": "/api/bitbucket", "service": "$bitbucket", "method": "webhook" }
    ]
}

API

  • webhook(request, response)
  • startDeployement(Array comments) : boolean
  • restart()

Installation

$ npm install qwebs-bitbucket-deploy

Package Sidebar

Install

npm i qwebs-bitbucket-deploy

Weekly Downloads

0

Version

0.2.18

License

MIT

Last publish

Collaborators

  • benoit.claveau