npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hubot-deployer

v0.2.2

Published

Giving Hubot the ability to deploy GitHub repos to PaaS providers

Downloads

3

Readme

Hubot Deploy

npm version Dependency Status

Deploy any GitHub repo to Heroku via Hubot

Hubot-Deployer gives Hubot the ability to deploy any github repository/branch to heroku without getting your hands dirty. It can even be configured by having a .yml file within the repository you are deploying. The only dependency required, is having a GitHub & Heroku account! (oh and maybe Node.js and npm aswell)

When deploying, in order to make the process as seamless as possible, it is recommended that you have a Procfile within your repo.

FYI: This is hubot-script will only work for slack right now

Installation

In hubot project repository, run:

$ npm install --save hubot-deployer

Then add hubot-deployer to your external-scripts.json:

[
    "hubot-deployer"
]

Configuration

Environmental variables

HUBOT_GITHUB_KEY - Github Application Key (personal access token)
HUBOT_GITHUB_ORG - Github Organization Name (optional, as you can specify org name in command)
HUBOT_HEROKU_KEY - Heroku Application Key (required if you are deploying to heroku)

YAML File (.yml)

If you are using the yaml file in your repo, its layout must adhere to the following:

deploy:
    heroku:
        master: (default branch - required)
            appname: foobar-123
        feature-branch: (name of a specific branch you have)
            appname: foobar-feature-123
        other: (the catch all - so required!)
            appname: foobar-dev-123

This file must be called the name of your hubot setup, e.g. if you called your Hubot ruby, then the file would be called ruby.yml.

Heroku Specifics

If you are deploying to heroku, to make the deployment smooth and successful, it is suggested that you make sure you have a Procfile already defined in your repo, so that when the build is created, the app will automatically be started.

Commands

Below are the commands that l want hubot to be able to do:

hubot:
- deploy <repo-name> to heroku - deploys the master branch of your org repo to heroku
- deploy <repo-name>/<repo-branch> to heroku - deploys the specified branch of this repo to heroku
- deploy <org-name>/<repo-name>/<repo-branch> to heroku - deploy this specific repo and branch to heroku
- deploy <user-name>/<repo-name>/<repo-branch> to heroku - same as above, but can be for user

Changelog

2015-03-04: Release Notes

So how does this work?

  1. The script parses the message sent to hubot to extract the details of the repository
  2. Using the GitHub API, hubot checks to make sure the repo and branch exist
  3. As long as the repo/branch exists, hubot then checks to see if there is a <bot name>.yml file present
  4. If the yaml file exists, then hubot will use the config specified in there to deploy, else it will use hubots default config
  5. Hubot then uses the GitHub API to grab the specific repo/branch tarball url
  6. It then uses the Heroku API to check if the app already exists on heroku
  7. If the app does exists, and you are the owner, then hubot will create a new build using the tarball url
  8. If the app doesn't exist, then hubot will create the new app using it's config, with the tarball url
  9. If all of the above steps are successful, then hubot will return the url of the new app/build

PaaS Providers Implemented