Skip to content

Commit 14c0023

Browse files
committed
Small tweaks to the new Docker Hubot Slack container example.
1 parent 55a7445 commit 14c0023

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

docker-hubot/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ This will generate a Docker image named `a4d/hubot-slack`, which you should see
1818

1919
To run the image, run the command below, replacing `TOKEN_HERE` with the API token your bot uses from Slack:
2020

21-
$ docker run -d --name "hubot-slack" -e HUBOT_
22-
SLACK_TOKEN=TOKEN_HERE a4d/hubot-slack
21+
$ docker run -d --name hubot -e HUBOT_SLACK_TOKEN=TOKEN_HERE a4d/hubot-slack
2322

24-
The container should be running in the background. You can inspect the logs from the bot using `docker logs hubot-slack`, and you can kill and remove the container with `docker rm -f hubot-slack`.
23+
The container should be running in the background. You can inspect the logs from the bot using `docker logs hubot`, and you can kill and remove the container with `docker rm -f hubot`.
2524

2625
## About the Author
2726

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
hubot_home: /home/hubot
23
hubot_owner: Ansible for DevOps
34
hubot_name: a4dbot
45
hubot_description: Ansible for DevOps test bot.

docker-hubot/roles/hubot-slack/tasks/main.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
name: sudo
55
state: present
66

7-
- name: Ensure hubot user exists.
8-
user:
9-
name: hubot
10-
create_home: yes
11-
127
- name: Install required Node.js packages.
138
npm:
149
name: "{{ item }}"
@@ -18,6 +13,12 @@
1813
- yo
1914
- generator-hubot
2015

16+
- name: Ensure hubot user exists.
17+
user:
18+
name: hubot
19+
create_home: yes
20+
home: "{{ hubot_home }}"
21+
2122
- name: Generate hubot.
2223
command: >
2324
yo hubot
@@ -26,13 +27,13 @@
2627
--description="{{ hubot_description }}"
2728
--adapter=slack
2829
--defaults
29-
chdir=/home/hubot
30+
chdir={{ hubot_home }}
3031
become: yes
3132
become_user: hubot
3233

3334
- name: Remove certain scripts from external-scripts.json.
3435
lineinfile:
35-
path: /home/hubot/external-scripts.json
36+
path: "{{ hubot_home }}/external-scripts.json"
3637
regexp: "{{ item }}"
3738
state: absent
3839
with_items:
@@ -43,5 +44,5 @@
4344

4445
- name: Remove the hubot-scripts.json file.
4546
file:
46-
path: /home/hubot/hubot-scripts.json
47+
path: "{{ hubot_home }}/hubot-scripts.json"
4748
state: absent

0 commit comments

Comments
 (0)