From b5125a5954f5f709f03af7682ec568d7a75cd070 Mon Sep 17 00:00:00 2001 From: Elizabeth Date: Mon, 1 Apr 2024 18:06:24 -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..31f0d5a 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 openssh + - 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