Skip to content

Commit 3520a32

Browse files
author
Андрей Игоревич Никитин
committed
deploy
1 parent 1007841 commit 3520a32

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: ssh ${{ secrets.JBOND_SSH_USER }}@${{ secrets.JBOND_SSH_HOST }} "cp -f $DIRECTORY/misc/jbond.service /usr/lib/systemd/system/"
4646
- name: replace service
4747
run: ssh ${{ secrets.JBOND_SSH_USER }}@${{ secrets.JBOND_SSH_HOST }} "systemctl daemon-reload && systemctl enable jbond.service && systemctl restart jbond.service"
48-
- name: restart cron
48+
- name: setup logrotate
4949
run: ssh ${{ secrets.JBOND_SSH_USER }}@${{ secrets.JBOND_SSH_HOST }} "cp -f $DIRECTORY/misc/jbond_logrotate /etc/logrotate.d/ && systemctl restart crond"
5050
- name: set token
5151
run: ssh ${{ secrets.JBOND_SSH_USER }}@${{ secrets.JBOND_SSH_HOST }} "echo ${{ secrets.JBOND_BOT_TOKEN }} > $DIRECTORY/token"

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
token
12
# Byte-compiled / optimized / DLL files
23
__pycache__/
34
*.py[cod]
@@ -174,9 +175,9 @@ cython_debug/
174175
.abstra/
175176

176177
# Visual Studio Code
177-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
178+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
178179
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
179-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
180+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
180181
# you could uncomment the following to ignore the enitre vscode folder
181182
# .vscode/
182183

src/jbond.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
# signal.signal(signal.SIGINT, signal_handler)
1515

1616

17-
bot = Bot(token=os.environ.get('JBOND_BOT_TOKEN'))
17+
with open("/opt/jbond/token", 'r') as token:
18+
bot = Bot(token=token.readline().strip())
19+
1820
dispatcher = Dispatcher(storage=MemoryStorage())
1921

2022

src/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ async def main():
1515
await dispatcher.start_polling(bot)
1616

1717
if __name__ == "__main__":
18-
logger.info(f"JBOND_BOT_TOKEN={os.environ.get('JBOND_BOT_TOKEN')}")
1918
asyncio.run(main())

0 commit comments

Comments
 (0)