mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-24 22:46:41 +07:00
#5 added drone file
This commit is contained in:
parent
948f5ae67c
commit
c0e06b337f
2 changed files with 82 additions and 16 deletions
82
.drone.yml
Normal file
82
.drone.yml
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
kind: pipeline
|
||||||
|
name: build
|
||||||
|
type: docker
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: compress
|
||||||
|
image: alpine
|
||||||
|
commands:
|
||||||
|
- rm -rf ./app.tar.bz2
|
||||||
|
- tar -cjf ./app.tar.bz2 -C ./ .
|
||||||
|
- name: upload
|
||||||
|
image: drillster/drone-rsync
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
environment:
|
||||||
|
RSYNC_KEY:
|
||||||
|
from_secret: rsync_key
|
||||||
|
RSYNC_USER:
|
||||||
|
from_secret: rsync_user
|
||||||
|
PLUGIN_ARGS: -zz -O --no-perms
|
||||||
|
settings:
|
||||||
|
port: 22522
|
||||||
|
hosts:
|
||||||
|
- vault48.org
|
||||||
|
source: ./
|
||||||
|
user: ${rsync_user}
|
||||||
|
key: ${rsync_key}
|
||||||
|
target: /tmp/tg-bot-${DRONE_BRANCH}
|
||||||
|
include:
|
||||||
|
- "app.tar.bz2"
|
||||||
|
exclude:
|
||||||
|
- "*"
|
||||||
|
- name: build
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
environment:
|
||||||
|
BUILD_PATH:
|
||||||
|
from_secret: build_path
|
||||||
|
ENV_PATH:
|
||||||
|
from_secret: env_path
|
||||||
|
settings:
|
||||||
|
host: vault48.org
|
||||||
|
username:
|
||||||
|
from_secret: rsync_user
|
||||||
|
key:
|
||||||
|
from_secret: rsync_key
|
||||||
|
envs: [build_path, env_path]
|
||||||
|
port: 22522
|
||||||
|
script_stop: true
|
||||||
|
script:
|
||||||
|
- mkdir -p $${BUILD_PATH}/${DRONE_BRANCH}
|
||||||
|
- rm -rf $${BUILD_PATH}/${DRONE_BRANCH}/*
|
||||||
|
- cd $${BUILD_PATH}/${DRONE_BRANCH}
|
||||||
|
- tar -xjf /tmp/tg-bot-${DRONE_BRANCH}/app.tar.bz2 -C ./
|
||||||
|
- cp -a $${ENV_PATH}/${DRONE_BRANCH}/. $${BUILD_PATH}/${DRONE_BRANCH}
|
||||||
|
- docker-compose -f ./docker/docker-compose.yml build
|
||||||
|
- docker-compose -f ./docker/docker-compose.yml up -d
|
||||||
|
- name: telegram_notify
|
||||||
|
image: appleboy/drone-telegram
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- success
|
||||||
|
- failure
|
||||||
|
settings:
|
||||||
|
token:
|
||||||
|
from_secret: telegram_token
|
||||||
|
to:
|
||||||
|
from_secret: telegram_chat_id
|
||||||
|
format: markdown
|
||||||
|
message: >
|
||||||
|
{{#success build.status}}🤓{{else}}😨{{/success}}
|
||||||
|
[{{repo.name}} / {{commit.branch}}]({{ build.link }})
|
||||||
|
```
|
||||||
|
{{ commit.message }}
|
||||||
|
```
|
|
@ -1,16 +0,0 @@
|
||||||
version: '3.4'
|
|
||||||
services:
|
|
||||||
db:
|
|
||||||
container_name: bot-db
|
|
||||||
image: postgres:11-alpine
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
environment:
|
|
||||||
POSTGRES_USER: user
|
|
||||||
POSTGRES_PASSWORD: password
|
|
||||||
POSTGRES_DB: bot
|
|
||||||
volumes:
|
|
||||||
- bot-db:/var/lib/postgresql/data
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
volumes:
|
|
||||||
bot-db: {}
|
|
Loading…
Add table
Add a link
Reference in a new issue