From 1ad12900ccb7f1fed6b97feab0776acee690d7b5 Mon Sep 17 00:00:00 2001 From: Elizabeth Date: Mon, 1 Apr 2024 18:05:02 -0600 Subject: [PATCH] add continuous deployment step --- .drone.yml | 32 ++++++++++++++++++++------------ deploy.sh | 13 +++++++++++++ 2 files changed, 33 insertions(+), 12 deletions(-) create mode 100755 deploy.sh diff --git a/.drone.yml b/.drone.yml index 3b251d6..0003265 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,18 +4,26 @@ type: docker name: build and publish docker image steps: -- name: docker - image: plugins/docker - settings: - username: - from_secret: gitea_packpub_username - password: - from_secret: gitea_packpub_password - registry: git.hatecomputers.club - repo: git.hatecomputers.club/hatecomputers/hatecomputers.club - tags: - - latest - - main + #- name: docker + # image: plugins/docker + # settings: + # username: + # from_secret: gitea_packpub_username + # password: + # from_secret: gitea_packpub_password + # registry: git.hatecomputers.club + # repo: git.hatecomputers.club/hatecomputers/hatecomputers.club + # tags: + # - latest + # - main +- name: continuous deployment + image: fedora:latest + commands: + - yum install --assumeyes + - sh deploy.sh + environment: + SSH_KEY: + from_secret: cd_ssh_key trigger: branch: - main diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..5e86854 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +echo $SSH_KEY >> /tmp/key +echo $SSH_KEY +echo $SSH_KEY | base64 +echo $(cat /tmp/key) +chmod -R 0600 /tmp/key + +ssh -i /tmp/key -o StrictHostKeyChecking=no root@hatecomputers.club "systemctl restart docker-compose@hatecomputers-club" + +rm /tmp/key