From 862d2c335c0a5ee3a01252de4a80e9d971453123 Mon Sep 17 00:00:00 2001 From: ghe0 Date: Sat, 8 Mar 2025 04:42:53 +0200 Subject: [PATCH] first push --- .gitignore | 1 + gitea/deploy_gitea.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 .gitignore create mode 100755 gitea/deploy_gitea.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1944fd6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.tmp diff --git a/gitea/deploy_gitea.sh b/gitea/deploy_gitea.sh new file mode 100755 index 0000000..eef0cfb --- /dev/null +++ b/gitea/deploy_gitea.sh @@ -0,0 +1,28 @@ +#!/bin/bash +hostname=gitea-example +set -e +export FORMAT=YAML + +detee-cli vm deploy --public-ip --location Vancouver --hostname $hostname > vm_info.tmp +vm_uuid=$(grep 'uuid:' vm_info.tmp | awk '{ print $2 }') +vm_ip=$(grep 'ip:' vm_info.tmp | awk '{ print $2 }') +key_path=$(grep 'key_path:' vm_info.tmp | awk '{ print $2 }') +ssh_command="ssh -i ${key_path} -p 22 root@${vm_ip}" + +echo VM created. Sleeping 10 seconds to allow SSH to start. +sleep 10 +echo Installing services... Saving log to vm_log.tmp +{ + $ssh_command pacman -Syu --noconfirm + $ssh_command pacman -S --noconfirm gitea + $ssh_command systemctl start gitea +} > vm_log.tmp 2>&1 + +echo +echo "To access gitea, visit http://${vm_ip}:3000/" +echo "For testing, use the database type SQLite. Also, don't forget to set the password for the admin account." +echo +echo "To SSH into the VM, run:" +echo " detee-cli vm ssh ${vm_uuid}" +echo "The VM will be up for 1 hour (using your LPs). Delete it by running:" +echo " detee-cli vm delete ${vm_uuid}"