added .drone.yml CI recipe and a deploy script
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
surtur 2020-03-21 00:28:39 +01:00
parent 40c4fe6bd0
commit 37f980f5b4
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 70 additions and 0 deletions

54
.drone.yml Normal file

@ -0,0 +1,54 @@
---
kind: pipeline
type: docker
name: deploy
steps:
- name: ssh-deploy
pull: always
image: appleboy/drone-ssh:latest
settings:
host:
from_secret: tew_host
username:
from_secret: tew_user
password:
from_secret: tew_passwd
script_stop: true
script:
- eval $(ssh-agent)
- ssh-add ~/.ssh/overlord
- cd ~/tew_0x00
- git pull
- ./deploy
---
kind: pipeline
name: notifications-deploy
platform:
os: linux
arch: amd64
clone:
disable: true
trigger:
status:
- success
- failure
depends_on:
- deploy
steps:
- name: discord
pull: always
image: appleboy/drone-discord:1.2.4
settings:
message: "{{#success build.status}} ✅ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` has been successfully deployed.\nevent: **`{{build.event}}`**\ncommit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`\n {{else}} ❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed to deploy.\nevent: **`${DRONE_BUILD_EVENT}`**\ncommit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`\n{{/success}}\n"
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token

16
deploy Normal file

@ -0,0 +1,16 @@
#!/bin/bash
USR=dotyaoverlord
HOST=dotya.ml
PUBDIR=tew_0x00public/
mkdir -pv public
cp -v index.html ./public
if [ $USER = $USR ]; then
rsync -av --delete public/ ~/${PUBDIR}
else
rsync -avz --delete public/ ${USR}@${HOST}:~/${PUBDIR}
fi
exit 0