Bot for Tox messenger
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tox-bot/.drone.yml

68 lines
1.6 KiB

---
kind: pipeline
type: docker
name: Deploy Tox Bot
clone:
disable: true
steps:
- name: clone
image: alpine/git
extra_hosts:
- "git.santic-zombie.ru:11.1.1.20"
commands:
- ping -c 1 git.santic-zombie.ru
- git clone https://git.santic-zombie.ru/santic/tox-bot.git .
- git checkout $DRONE_COMMIT
- tar -czpf tox.tar.gz *
- name: prepare source
image: appleboy/drone-ssh
settings:
host:
- 11.1.1.21
username: tox
key:
from_secret: rsa_key
port: 22
command_timeout: 2m
script:
- if [ ! -d ~/tox_source ]; then mkdir ~/tox_source; fi
- if [ ! -d ~/tox_bot ]; then mkdir ~/tox_bot; fi
- if [ -f ~/tox_bot/echo_bot ]; then rm ~/tox_bot/echo_bot; fi
- name: copy files
image: appleboy/drone-scp
settings:
host:
- 11.1.1.21
username: tox
key:
from_secret: rsa_key
port: 22
target: ~/
source: tox.tar.gz
- name: build
image: appleboy/drone-ssh
settings:
host:
- 11.1.1.21
username: tox
key:
from_secret: rsa_key
port: 22
command_timeout: 2m
script:
- tar -xvzf tox.tar.gz -C ~/tox_source
- ls -la ~/tox_source
- cd ~/tox_source/src
- gcc -o echo_bot tox_bot.c commands.c misc.c -std=gnu99 -lsodium -I /usr/local/include/ -ltoxcore -lconfig
- cp echo_bot ~/tox_bot
- cp ../{bot.cfg,masterkeys.txt} ~/tox_bot
- ls -lta ~/tox_bot
- rm -rfd ~/tox_source
- rm ~/tox.tar.gz