1.1.2 • Published 6 years ago

deploify v1.1.2

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

Deploify

This module allows to create a temporary staging enviroment on Heroku for each of a repository pull request on Bitbucket, leveraging your Heroku account and Bitbucket webhooks.

Setup:

1. Setup the module to work with your Express server

const express = require('express');
const app = express();

require('deploify')(app, {
  webhook_endpoint: "/webhook/bitbucket",
  bitbucket_user: "foo",
  bitbucket_email: "foo@bar.com",
  bitbucket_password: ""*******",
  bitbucket_key: "...",
  bitbucket_secret: "...",
  heroku_user: "foo@bar.com",
  heroku_password: "*******",
  domain_prefix: "fooqapreview-",
  branch_regex: /^qa-(.*)/,
  env_vars: {
    QA: "true"
  }
});
ParamTypeDescription
appfunctionExpress instance
configObjectConfiguration object
config.webhook_endpointstringEndpoint for Bitbucket's webhook (e.g.: /webhooks/bitbucket)
config.bitbucket_userstringBitbucket username
config.bitbucket_passwordstringBitbucket password
config.bitbucket_emailstringBitbucket email
config.bitbucket_keystringBitbucket OAuth key
config.bitbucket_secretstringBitbucket OAuth secret
config.heroku_userstringHeroku username (email)
config.heroku_passwordstringHeroku password
config.domain_prefixstringDomain prefix for apps (e.g.: qapreview- will result in domains like qapreview-435.herokuapp.com)
config.branch_regexRegExpRegex to match in branch names (apps will be created only for matched branches)
config.env_varsObjectEnvironment variables to be attached to Heroku apps

2. Create the webhook on the Bitbucket repository of your choice

Go to your repository page, then follow Settings -> Workflow -> Webhooks -> Add webhook. Create a webhook choosing from the list of triggers the following events of the Pull Request: Created, Updated, Merged and Declined.

Webhook creation