Skip to content

Commit

Permalink
Merge pull request #70 from raccube/rename-discord-bot
Browse files Browse the repository at this point in the history
Rename discord-gated-entry to discord-bot
  • Loading branch information
RealOrangeOne authored Sep 1, 2024
2 parents db82a56 + d68947a commit c78a275
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
roles:
- competitor-services-nginx
- code-submitter
- discord-gated-entry
- discord-bot

- name: Kit services
hosts: kitsvcs
Expand Down
5 changes: 5 additions & 0 deletions roles/discord-bot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SR Discord Bot

A Bot for gating entry to a Discord server.

This is a deployment of <https://github.com/srobo/discord-bot>.
4 changes: 4 additions & 0 deletions roles/discord-bot/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Restart discord-bot
service:
name: discord-bot
state: restarted
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

- name: Download
git:
repo: https://github.com/srobo/discord-gated-entry
repo: https://github.com/srobo/discord-bot
dest: "{{ install_dir }}"
force: true
version: 476a9c942f580e2950048c2b95e15429cb0ae33d
version: b12c95980701d6c090f7b0da16499475011b0026
notify:
Restart discord-gated-entry
register: discord_gated_entry_repo
Restart discord-bot
register: discord_bot_repo
become_user: discord

- name: Bootstrap environment file
Expand All @@ -37,27 +37,27 @@
mode: "0600"
owner: discord
notify:
Restart discord-gated-entry
Restart discord-bot

- name: Install virtual environment
pip:
virtualenv: "{{ venv_dir }}"
requirements: "{{ install_dir }}/requirements.txt"
name: file://{{ install_dir }}
notify:
Restart discord-gated-entry
Restart discord-bot
become_user: discord
when: discord_gated_entry_repo.changed # noqa: no-handler - Use a handler to ensure execution order
when: discord_bot_repo.changed # noqa: no-handler - Use a handler to ensure execution order

- name: Install systemd service
template:
src: discord-gated-entry.service
dest: /etc/systemd/system/discord-gated-entry.service
src: discord-bot.service
dest: /etc/systemd/system/discord-bot.service
mode: "0644"
notify:
Restart discord-gated-entry
Restart discord-bot

- name: Enable service
service:
name: discord-gated-entry
name: discord-bot
state: started
enabled: true
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Discord bot for gated entry
Description=Discord bot
After=network.target

[Service]
Expand All @@ -8,9 +8,9 @@ User=discord
Type=simple

WorkingDirectory={{ install_dir }}
RuntimeDirectory=discord-gated-entry
RuntimeDirectory=discord-bot

ExecStart=/srv/discord-gated-entry/venv/bin/python main.py
ExecStart={{ venv_dir }}/bin/python -m sr.discord_bot

[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions roles/discord-bot/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install_dir: /srv/discord-bot
venv_dir: "{{ install_dir }}/venv"
5 changes: 0 additions & 5 deletions roles/discord-gated-entry/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions roles/discord-gated-entry/handlers/main.yml

This file was deleted.

2 changes: 0 additions & 2 deletions roles/discord-gated-entry/vars/main.yml

This file was deleted.

0 comments on commit c78a275

Please sign in to comment.