diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 75ac185..0000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: node_js - -node_js: - - "0.11" - -services: - - redis-server - -install_script: npm install - -script: npm test - -branches: - only: - # Travis will build annotated tags as branches unless we restrict to this - - master - -deploy: - provider: heroku - api_key: - secure: DAUK1W6LYfoE+sdXrPUvq/g90nIFm1at/4rO3eAxbc+7T0MvUSrzwqmC6JaKWJbHKNdfxjsJHqGJZYh6h/ZxDipTUTKt4jQugIl14IoeqzTSmHldnbIxnwqPIaGPTNogxsfCsDcmIK8HsXMjLMRzChGsPOUJM93arlGvjtLZTYI= - app: - master: roobot-test - on: - repo: gratipay/roobot - tags: true - # Official hack: http://docs.travis-ci.com/user/deployment/heroku/#Conditional-Deploys - all_branches: true - -notifications: - email: false - irc: - channels: - - "chat.freenode.org#gratipay" - on_success: change - on_failure: always - template: - - "%{repository} (%{branch}:%{commit} by %{author}): %{message} (%{build_url})" - skip_join: true diff --git a/Gruntfile.coffee b/Gruntfile.coffee deleted file mode 100755 index d4d15f1..0000000 --- a/Gruntfile.coffee +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = (grunt) -> - grunt.initConfig - release: - options: - bumpShrinkwrap: true - tagType: 'annotated' - tagName: "v<%= version %>" - commitMessage: "Prepare for release v<%= version %>" - tagMessage: "Annotated tag v<%= version %>" - npm: false - npmtag: false - - grunt.loadNpmTasks 'grunt-release' diff --git a/README.md b/README.md index 218cf85..ead46b8 100644 --- a/README.md +++ b/README.md @@ -12,105 +12,44 @@ This is Gratipay's version of GitHub's Campfire bot, hubot. He's pretty cool. To test roobot locally: -``` -git clone git@github.com:gratipay/roobot.git && cd roobot -npm install -bin/hubot -n roobot -``` + git clone git@github.com:gratipay/roobot.git && cd roobot + npm install + bin/hubot -n roobot ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md). +roobot is composed of a core ([hubot][]) and a set of scripts. The configuration is +done through environment variables. -## Deploying - -Defore deploying changes, you'll need to do the following: - - * install [**Grunt CLI**](http://gruntjs.com/): `[sudo] npm install --global grunt-cli` - * install Heroku Toolbelt CLI - * install [Heroku pipeline plugin](https://devcenter.heroku.com/articles/labs-pipelines): - `heroku plugins:install git://github.com/heroku/heroku-pipeline.git` - -``` -git clone git@github.com:gratipay/roobot.git -git checkout master -grunt release[:patch | :minor | :major] - -# Here's what will happen: -# 1. Grunt will push to origin remote (GitHub). -# 2. Travis will run tests. -# 3. On success, Travis will push to `roobot-test` Heroku app. - -# Confirm the bot is working in #gratipay-test - -# Confirm logs look fine -heroku --app=roobot-test logs - -# Promote the build from test to prod (ie. #gratipay) -heroku --app=roobot-test pipeline:promote -heroku --app=roobot-prod ps:restart web # If previous dyno still has nickname -heroku --app=roobot-prod logs -``` - -### Sensitive Deploys - -Sometimes, when pushing sensitive releases, you don't want a public -record of the release to exist prior to successfully deploying live on -Heroku. For example, we don't want a fixed critical bug commit public on -GitHub, and this dangerous situation would be exacerbated if the -subsequent Heroku deploy failed. +Scripts come for three sources: -To push directly to Heroku first: +- the `hubot-scripts.json` file, it adds scripts from the official [hubot-scripts][] repository +- the `external-scripts.json` file, it adds scripts from standalone repositories (e.g. [hubot-seen][]) +- the `scripts` directories, it contains our own custom scripts -``` -git remote add heroku git@heroku.com:roobot-test.git -git config branch.master.remote heroku -grunt release[:patch | :minor | :major] -git config branch.master.remote origin - -# Confirm the bot is working in #gratipay-test... - -# Carry through above steps from normal deploy - -# Push to GitHub once changes are live on prod -git push origin master --tags -``` -![Hubot deploy pipeline](https://rawgithub.com/gratipay/roobot/master/docs/hubot-deploy-workflow.svg) - -### Scripting - -Take a look at the scripts in the `./scripts` folder for examples. -Delete any scripts you think are useless or boring. Add whatever functionality you -want hubot to have. Read up on what you can do with hubot in the [Scripting Guide](https://github.com/github/hubot/blob/master/docs/scripting.md). - -## hubot-scripts - -There will inevitably be functionality that everyone will want. Instead -of adding it to hubot itself, you can submit pull requests to -[hubot-scripts][hubot-scripts]. - -To enable scripts from the hubot-scripts package, add the script name with -extension as a double quoted string to the `hubot-scripts.json` file in this -repo. +Take a look at the [Scripting Guide][] if you want to write a new script. +[hubot]: https://github.com/github/hubot [hubot-scripts]: https://github.com/github/hubot-scripts +[hubot-seen]: https://github.com/gratipay/hubot-seen +[Scripting Guide]: https://github.com/github/hubot/blob/master/docs/scripting.md -## external-scripts +## Deploying -Tired of waiting for your script to be merged into `hubot-scripts`? Want to -maintain the repository and package yourself? Then this added functionality -maybe for you! + git remote add heroku git@heroku.com:roobot-test.git + git remote add heroku-prod git@heroku.com:roobot-prod.git -Hubot is now able to load scripts from third-party `npm` packages! To enable -this functionality you can follow the following steps. + # Deploy to the test channel + git push heroku -1. Add the packages as dependencies into your `package.json` -2. `npm install` to make sure those packages are installed + # Confirm the bot is working in #gratipay-test + # Take a look at the logs if there is a problem: + # heroku -a roobot-test logs -t -To enable third-party scripts that you've added you will need to add the package -name as a double quoted string to the `external-scripts.json` file in this repo. + # If all is well deploy to the prod channel (i.e. #gratipay) + git push heroku-prod -## Restart the bot +## Restarting the bot You may want to get comfortable with `heroku logs` and `heroku restart` if you're having issues. diff --git a/docs/hubot-deploy-workflow.svg b/docs/hubot-deploy-workflow.svg deleted file mode 100644 index afd6b0c..0000000 --- a/docs/hubot-deploy-workflow.svg +++ /dev/null @@ -1,437 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - roobot-test - IRCbot namegit url - #gratipay-testroobot-testgit@heroku.com:roobot-test.git - #gratipayroobotgit@heroku.com:roobot-prod.git - - - prro - - - - - - roobot-prod - - - - - `heroku pipeline:promote` - - diff --git a/package.json b/package.json index 6a8ed08..fb3ebd9 100644 --- a/package.json +++ b/package.json @@ -40,10 +40,6 @@ "hubot-tell": "*", "oauth": "*" }, - "devDependencies": { - "grunt": "^0.4.2", - "grunt-release": "git://github.com/patcon/grunt-release.git#bump-shrinkwrap" - }, "scripts": { "shrinkwrap": "rm -r node_modules npm-shrinkwrap.json && npm install && npm shrinkwrap" },