From 3210ca13673e07f0b32c6403899b39cf420adc8e Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Fri, 27 Nov 2020 14:24:18 +0100 Subject: [PATCH] Added deploy script --- content/posts/Test.md | 6 ------ deploy | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) delete mode 100644 content/posts/Test.md create mode 100755 deploy diff --git a/content/posts/Test.md b/content/posts/Test.md deleted file mode 100644 index 12a876a..0000000 --- a/content/posts/Test.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: "Test" -date: 2020-11-27T12:35:20Z -draft: true ---- - diff --git a/deploy b/deploy new file mode 100755 index 0000000..3e3360b --- /dev/null +++ b/deploy @@ -0,0 +1,21 @@ +#!/usr/bin/env sh + +# Generate the new files +hugo + +# Compress them into a ball +tar -czf public.tar.gz public + +# Copy tarball to server +scp -P 2222 public.tar.gz jjr@ruby.roosens.me:/srv/nginx/sites/ + +# Unpack the tarball +ssh -p 2222 jjr@ruby.roosens.me bash << EOF +cd /srv/nginx/sites/ && tar -xf public.tar.gz && \\ +rm -rf blog && \\ +mv public blog && \\ +rm public.tar.gz +EOF + +# Delete the tarball +rm public.tar.gz