forked from shaunburdick/slack-ooo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rewriting _everything_ * Adding travis yml file
- Loading branch information
1 parent
04c82f7
commit 60e1665
Showing
43 changed files
with
918 additions
and
4,712 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
node_modules | ||
npm-debug.log | ||
config.js | ||
/config.js | ||
doc/* | ||
/coverage/ | ||
/.nyc_output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- "5" | ||
- "6" | ||
after_success: npm run coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
FROM node:latest | ||
FROM rezzza/docker-node:latest | ||
|
||
MAINTAINER Shaun Burdick <[email protected]> | ||
|
||
RUN apk add -U tzdata | ||
|
||
ENV NODE_ENV=production \ | ||
SLACK_TOKEN=xoxb-foo \ | ||
SLACK_AUTO_RECONNECT=true \ | ||
|
@@ -13,4 +15,4 @@ WORKDIR /usr/src/myapp | |
|
||
RUN ["npm", "install"] | ||
|
||
CMD ["npm", "start"] | ||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
GNU GENERAL PUBLIC LICENSE | ||
|
||
Copyright (c) 2016 Shaun Burdick | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bot: npm start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "Slack OOO", | ||
"description": "Slack Out of Office Message Responder", | ||
"keywords": [ | ||
"slack", | ||
"bot", | ||
"ooo", | ||
"out of office" | ||
], | ||
"repository": "https://github.com/shaunburdick/slack-ooo", | ||
"env": { | ||
"SLACK_TOKEN": { | ||
"description": "Your Slack token" | ||
}, | ||
"SLACK_AUTO_RECONNECT": { | ||
"description": "Reconnect on disconnect", | ||
"value": "true" | ||
}, | ||
"NODE_ENV": { | ||
"value": "production" | ||
} | ||
}, | ||
"image": "heroku/nodejs", | ||
"formation": { | ||
"bot": { | ||
"quantity": 1, | ||
"size": "free" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var config = { | ||
slack: { | ||
token: 'xoxb-foo', | ||
autoReconnect: true | ||
} | ||
}; | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
bot: | ||
image: shaunburdick/slack-ooo | ||
restart: on-failure | ||
environment: | ||
SLACK_TOKEN: 'xoxb-foo' | ||
SLACK_AUTO_RECONNECT: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict'; | ||
|
||
const logger = require('./lib/logger')(); | ||
const redact = require('redact-object'); | ||
const Bot = require('./lib/bot'); | ||
const Config = require('./lib/config'); | ||
|
||
let config; | ||
|
||
/** | ||
* Load config | ||
*/ | ||
const rawConfig = (() => { | ||
let retVal; | ||
try { | ||
retVal = require('./config'); | ||
} catch (exception) { | ||
retVal = require('./config.default'); | ||
} | ||
|
||
return retVal; | ||
})(); | ||
|
||
try { | ||
config = Config.parse(rawConfig); | ||
} catch (error) { | ||
logger.error('Could not parse config', error); | ||
process.exit(1); | ||
} | ||
|
||
logger.info('Using the following configuration:', redact(config, ['token'])); | ||
|
||
logger.info('Starting Bot...'); | ||
const bot = new Bot(config); | ||
bot.start(); |
Oops, something went wrong.