Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

everything #1

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open

everything #1

wants to merge 55 commits into from

Conversation

davidchambers
Copy link
Member

@davidchambers davidchambers commented Feb 18, 2017

TODO:

bin/hubot Outdated
#!/usr/bin/env bash
set -e

PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH" \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from the automatically generated boilerplate. Is it required? If not, let's remove it.

Makefile Outdated
@@ -0,0 +1,14 @@
ESLINT = node_modules/.bin/eslint --config node_modules/sanctuary-style/eslint-es3.json --env es3 --env node
NPM = npm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Npm? ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, yes. :)

package.json Outdated
"sanctuary-type-classes": "*"
},
"devDependencies": {
"eslint": "2.9.x",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very old version of Eslint.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. The reason I'm specifying an old version is that [email protected] does not make use of any rules added since [email protected]. We should update sanctuary-style to the latest version of ESLint then update both dependencies at once (here and in other projects).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

package.json Outdated
"version": "0.0.0",
"private": true,
"author": "David Chambers <[email protected]>",
"description": "A simple helpful robot for your Company",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this description from the boilerplate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was. ⚡

circle.yml Outdated

machine:
node:
version: 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why Node 4 instead of 6 or 7?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No good reason. Node 4 came installed on Ubuntu. For a small project it doesn't matter much to me which Node version we use so I'm happy to stick with the default.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. In the case of a bot it might be worth it to consider updating. It would allow us to use the full set of ES6 features in the code we write.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent point! I had not considered that. I'll install Node 6 on the server. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the server? It would be nice to do it with infrastructure as code, maybe use a Docker container so its configuration would be in source control.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the server?

On Linode currently.

It would be nice to do it with infrastructure as code, maybe use a Docker container so its configuration would be in source control.

Sounds great! This needn't happen as part of this initial pull request though. ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. My preference is to always put code into production with provisioning scripts. Retrofitting is always harder.

Dockerfile Outdated

COPY . .

ENTRYPOINT ["dumb-init", "bin/hubot"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you review this, @svozza? I'm quite new to Docker. I followed some of these suggestions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a really good article. I like the trick about caching the node_modules layer. LGTM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, if you want to set Hubot to listen on a specific port you can do ENV PORT 3000. Then when running your container you do the port mapping with the -p option on docker run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is it possible to make CircleCI build and push new image to DockerHub whenever there's a successful merge to master?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, if you want to set Hubot to listen on a specific port you can do ENV PORT 3000.

Does Hubot listen? My understanding is that it makes a request to the Gitter streaming API and consumes the response indefinitely.

Also, is it possible to make CircleCI build and push new image to DockerHub whenever there's a successful merge to master?

Would it also be possible to automatically update the Linode in response to this push? If not it seems reasonable to me to publish to Docker Hub via xyz, then pull and restart the bot on the Linode manually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, looking at the docs Linode really doesn't seem set up for CD, if it was something like Elastic Beanstalk I could knock up a fully automated build pipeline relatively simply. But lets leave that for another day. 😉

scripts/eval.js Outdated

module.exports = bot => {

bot.respond(/```(?:javascript|js)?$([\s\S]*)```/m, res => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could replace [\s\S] with [^], I think.

@davidchambers davidchambers force-pushed the davidchambers/everything branch from 53ad407 to 6a7ddfb Compare April 27, 2019 21:04
@davidchambers davidchambers force-pushed the davidchambers/everything branch from 6a7ddfb to 856313f Compare April 27, 2019 21:16
@davidchambers davidchambers force-pushed the davidchambers/everything branch from 154e99e to 6e49b8f Compare December 6, 2023 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants