Add CI/CD
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Tobias Manske 2023-12-26 17:34:38 +01:00
parent 6bc9946078
commit f83476b471
Signed by: tobias
GPG Key ID: 9164B527694A0709
2 changed files with 48 additions and 0 deletions

46
.drone.yml Normal file
View File

@ -0,0 +1,46 @@
---
kind: pipeline
type: docker
name: default
trigger:
branch:
- master
event:
include:
- cron
- custom
steps:
- name: Reddit Save
image: python:3.11
privileged: true
environment:
HETZNER_USER:
from_secret: hetzner_username
HETZNER_KEY:
from_secret: hetzner_key
REDDIT_USERNAME:
from_secret: REDDIT_USERNAME
REDDIT_PASSWORD:
from_secret: REDDIT_PASSWORD
REDDIT_CLIENT_ID:
from_secret: REDDIT_CLIENT_ID
REDDIT_SECRET:
from_secret: REDDIT_SECRET
commands:
- apt update && apt install -y sshfs
- mkdir $${HOME}/reddit-save
- mkdir $${HOME}/.ssh
- chmod 700 $${HOME}/.ssh
- echo "$${HETZNER_KEY}" > $${HOME}/.ssh/id_ed25519
- chmod 600 $${HOME}/.ssh/id_ed25519
- cp ./known_hosts $${HOME}/.ssh
- sshfs -p 23 $${HETZNER_USER}@u309229.your-storagebox.de:reddit-save $${HOME}/reddit-save
- pip3 install -r requirements.txt
- python3 save.py saved $${HOME}/reddit-save/saved
- python3 save.py upvoted $${HOME}/reddit-save/upvoted
image_pull_secrets:
- registry

2
known_hosts Normal file
View File

@ -0,0 +1,2 @@
|1|z2izyEgiMEMXpw90jg0e1ISllhc=|sT2TrIky19K4oxuOX72ikIyXlKY= ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAGK0po6usux4Qv2d8zKZN1dDvbWjxKkGsx7XwFdSUCnF19Q8psHEUWR7C/LtSQ5crU/g+tQVRBtSgoUcE8T+FWp5wBxKvWG2X9gD+s9/4zRmDeSJR77W6gSA/+hpOZoSE+4KgNdnbYSNtbZH/dN74EG7GLb/gcIpbUUzPNXpfKl7mQitw==
|1|dqv6tJGy56u8qZnwjPPD2jf+j+I=|kP5pemnOAbC8NuznJOYvLbqT3uo= ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAGK0po6usux4Qv2d8zKZN1dDvbWjxKkGsx7XwFdSUCnF19Q8psHEUWR7C/LtSQ5crU/g+tQVRBtSgoUcE8T+FWp5wBxKvWG2X9gD+s9/4zRmDeSJR77W6gSA/+hpOZoSE+4KgNdnbYSNtbZH/dN74EG7GLb/gcIpbUUzPNXpfKl7mQitw==