|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: Deploy 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 [ ! -f ~/tox_source ]; then mkdir ~/tox_source; 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 dtox.tar.gz -C ~/tox_source
|
|
|
|
- ls -la ~/tox_source
|
|
|
|
|
|
|
|
|
|
|
|
# server:
|
|
|
|
# host: 11.1.1.21
|
|
|
|
# user: tox
|
|
|
|
# ssh_key:
|
|
|
|
# from_secret: rsa_key
|
|
|
|
|
|
|
|
# - name: build
|
|
|
|
# commands:
|
|
|
|
# - cd src/
|
|
|
|
# - gcc -o echo_bot tox_bot.c commands.c misc.c -std=gnu99 -lsodium -I /usr/local/include/ -ltoxcore -lconfig
|
|
|
|
# - mkdir ~/tox_bot
|
|
|
|
# - cp echo_bot ~/tox_bot
|
|
|
|
# - cp ../{bot.cfg,masterkeys.txt} ~/tox_bot
|
|
|
|
# - ls -lta ~/
|
|
|
|
# - sleep 15
|