Skip to content

Latest commit

 

History

History
91 lines (60 loc) · 2.2 KB

CONTRIBUTING.md

File metadata and controls

91 lines (60 loc) · 2.2 KB

Environment Setup

SlashDeploy uses a Gemfile to document dependencies.

The following external dependencies are also required:

  • Postgresql 9.6
  • Ruby 2.5.1 (optionally rbenv)
  • bundler

macOS

  1. install brew
  2. install PostgreSQL 9: brew install postgresql@9.6
  3. start PostgreSQL 9 : brew services start postgresql@9.6
  4. install rbenv: brew install rbenv
  5. install bundler: gem install bundler

Linux

  1. TODO

Install SlashDeploy

  1. clone slashdeploy: git clone git@github.com:remind101/slashdeploy.git
  2. change dir to project root: cd slashdeploy
  3. install slashdeploy: bundle install
  4. create database schema: bundle exec rake db:setup
  5. migrate database schema: bundle exec rake db:migrate

Docker

You can also use Docker for development and testing:

make test

Tests

The full test suite can be run with:

./bin/rake

Development

Using ngrok

  1. Install ngrok and run ./ngrok http 3000

Setup a new Slack App

  1. Create a Slack App
  2. Set your Interactive Components Request URL to https://xxx.ngrok.io/slack/actions
  3. Add a new OAuth & Permissions Redirect URL with the value https://xxx.ngrok.io/auth/slack/callback
  4. Add a new /deploy command by setting the Request URL to https://xxx.ngrok.io/slack/commands

Setup a new Github OAuth App

  1. Register a new Github OAuth Application
  2. Set your Github Authorization callback URL to http://xxx.ngrok.io/auth/github/callback

Start the Development server

  1. Using Slack and Github app credentials, set the following environment variables in a .env file:
STATE_KEY=""

# the ngrok.io URI.
URL="https://xxx.ngrok.io"

# find these on the Github OAuth App's Developer settings page.
GITHUB_CLIENT="github"
GITHUB_CLIENT_ID=""
GITHUB_CLIENT_SECRET=""

# find these on the Slack App's Basic Information tab.
SLACK_CLIENT="slack"
SLACK_CLIENT_ID=""
SLACK_CLIENT_SECRET=""
SLACK_VERIFICATION_TOKEN=""
  1. foreman start -p 3000

Functional Tests

  1. Create a Slack team and add SlashDeploy to it using the button on https://xxx.ngrok.io