Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benoitclaveau/qwebs-bitbucket-deploy
https://github.com/benoitclaveau/qwebs-bitbucket-deploy
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/benoitclaveau/qwebs-bitbucket-deploy
- Owner: BenoitClaveau
- License: mit
- Created: 2017-01-18T08:55:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-17T21:58:42.000Z (over 7 years ago)
- Last Synced: 2024-12-01T02:03:44.285Z (28 days ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qwebs-auth-jwt
Qwebs webhook service to deploy from bitbucket.
## Features* [Qwebs](https://www.npmjs.com/package/qwebs)
### Override default behaviour
```services/bitbucket.js
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
```route.json
{
"services": [
{ "name": "$bitbucket", "location": "./services/bitbucket" }
],
"locators": [
{ "post": "/api/bitbucket", "service": "$bitbucket", "method": "webhook" }
]
}
```## API
* webhook(request, response)
* startDeployement(Array comments) : boolean
* restart()## Installation
```bash
$ npm install qwebs-bitbucket-deploy
```