Giter Club home page Giter Club logo

deploify's Introduction

Deploify

NPM version

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. It's a Bitbucket alternative to Review Apps for GitHub and GitLab.

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: "[email protected]",
  bitbucket_password: ""*******",
  bitbucket_key: "...",
  bitbucket_secret: "...",
  heroku_user: "[email protected]",
  heroku_password: "*******",
  domain_prefix: "fooqapreview-",
  branch_regex: /^qa-(.*)/,
  env_vars: {
    QA: "true"
  }
});
Param Type Description
app function Express instance
config Object Configuration object
config.webhook_endpoint string Endpoint for Bitbucket's webhook (e.g.: /webhooks/bitbucket)
config.bitbucket_user string Bitbucket username
config.bitbucket_password string Bitbucket password
config.bitbucket_email string Bitbucket email
config.bitbucket_key string Bitbucket OAuth key
config.bitbucket_secret string Bitbucket OAuth secret
config.heroku_user string Heroku username (email)
config.heroku_password string Heroku password
config.domain_prefix string Domain prefix for apps (e.g.: qapreview- will result in domains like qapreview-435.herokuapp.com)
config.branch_regex RegExp Regex to match in branch names (apps will be created only for matched branches)
config.env_vars Object Environment 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

Todo

  • Better error handling
  • Test coverage
  • Manual deployment
  • GitLab integration
  • Support to more hosting providers

deploify's People

Contributors

flaviolivolsi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.