-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
37 lines (35 loc) · 1.04 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
stages:
- deploy
deploy production:
stage: deploy
only:
- master@obittner/TwitchStickerBot
- web
- triggers
- schedules
environment:
name: production
url: https://t.me/TwitchStickersBot
variables:
path: '/opt/telegram/TwitchStickerBot'
venv: '/opt/telegram/TwitchStickerBot/venv'
python: '$venv/bin/python'
script:
- "sudo /bin/systemctl stop twitchstickerbot.service"
- "python3 -m venv --clear $venv"
- "$python -m pip install --upgrade pip"
- "$python -m pip install -r ./requirements.txt"
- "chgrp -hR telegram $venv"
- "chgrp -hR telegram ./"
- "rsync -rvl --exclude='.git/'
--exclude='.gitlab-ci.yml'
--exclude='.gitignore'
--exclude='README.md'
--exclude='venv/'
--exclude='requirements.txt'
--exclude='config.ini'
--delete
--chmod=775
--group
./ $path"
- "sudo /bin/systemctl start twitchstickerbot.service"