Skip to content

Commit

Permalink
Merge 880a25b into ff03b27
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-genova-ntt committed Feb 5, 2019
2 parents ff03b27 + 880a25b commit 5dcb5e8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: Wh5elKsNWdAQJEQHAwccJCmLi2O0umZDY
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ install:
- npm install

script:
- npm test
- npm test
- npm run coveralls
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,41 @@

The idea behind this project is to produce a NODEJS module to publish a card on a Slack Chat. _Example_:

![Slack Attachment](https://github.com/marco-genova-ntt/lighthouse-score-for-slack/blob/master/assests/img/card.png)
![Slack Attachment](https://github.com/marco-genova-ntt/lighthouse-score-for-slack/blob/master/assets/img/card.png)

A valid example of usage is here: https://github.com/marco-genova-ntt/lighthouse-ci

## Technological Stack
NodeJs + ES6 (*powered by babel*)
Test framework: Jest
* NodeJS 8+
* Babel 7
* Jest
* Dotenv

The project is ES6-based.

## Integration with Slack
In order to enable the integration with slack channel, a Slack Apps was created to create. Actually it's not published.
The name of the slack app is "LightHouse Score Publisher".

**NOTE**: In order to publish in a channel it's important to retrive an OAUTH token from slack you can create a non redistribuable application and use the bot token:

![Slack Bot OAUTH Token](https://github.com/marco-genova-ntt/lighthouse-score-for-slack/blob/master/assets/img/token.png)

## How to define _.env_ in the project

The following properties can be added to an existent _.env_ file:

```
#Slack token for the slack client, An access token (from your Slack app or custom integration - xoxp, xoxb)
SLACK_TOKEN=xoxb-.....,
#Slack channel identifier, use Web API simulator to extract this value (https://api.slack.com/methods/conversations.list)
SLACK_CHANNEL_ID=C6H41XTRU
#Base api url, use this for the actual version of api
SLACK_BASE_API=https://slack.com/api/{method}?token={token}&pretty=1
```

## References
1. https://nttdataclickcollect.slack.com/apps
2. https://api.slack.com/custom-integrations/web
File renamed without changes
Binary file added assets/img/token.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "lighthouse-score-for-slack",
"version": "0.1.6",
"version": "0.1.7",
"description": "LightHouse Score Publisher - Module used to communicate with slack",
"main": "./dist/app/index.js",
"scripts": {
"test": "npm run build && jest --coverage --config jest.conf.json",
"coveralls": "npm run build && jest --coverage && cat ./coverage/lcov.info | coveralls",
"build": "rimraf dist/ && babel ./app --out-dir dist/app --copy-files && babel ./__tests__ --out-dir dist/__tests__ --copy-file",
"start": "npm run build && node dist/app/index.js"
},
Expand Down Expand Up @@ -33,6 +34,7 @@
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^24.0.0",
"babel-loader": "^8.0.0",
"coveralls": "^3.0.2",
"jest": "^24.0.0",
"rimraf": "^2.6.3"
},
Expand Down

0 comments on commit 5dcb5e8

Please sign in to comment.