summaryrefslogtreecommitdiff
path: root/.local/bin/upsite
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-03-06 14:59:00 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-03-06 14:59:00 -0500
commit03dd8b3cd8d03300ee85377ea40fa486819d2ebc (patch)
treecdeffd7721bb73918184a83c2f9c034142381564 /.local/bin/upsite
parentb9581d702f388489725ff7d5a7394009124b5154 (diff)
Update shortcutgen env and misc others
Diffstat (limited to '.local/bin/upsite')
-rwxr-xr-x.local/bin/upsite27
1 files changed, 22 insertions, 5 deletions
diff --git a/.local/bin/upsite b/.local/bin/upsite
index c6ef404..5b15d21 100755
--- a/.local/bin/upsite
+++ b/.local/bin/upsite
@@ -1,11 +1,28 @@
#!/bin/sh
-sitename="chausse.xyz"
+username="master"
+url="chausse.xyz"
+siteroot="$HOME/Workspace/$url"
-branch="construction"
-
-cd "$HOME/Workspace/$sitename$construction" && git pull origin $branch && git checkout $branch
+case "$1" in
+ -d|--dev)
+ url="dev.$url"
+ destdir="/var/www/dev"
+ branch="master"
+ ;;
+ -m|--main)
+ destdir="/var/www/chausse"
+ branch="construction"
+ ;;
+ *)
+ echo "Usage: upsite [dev|main]"
+ exit 1
+ ;;
+esac
+cd "$siteroot" || exit 1
+git checkout $branch
+git pull
hugo --gc=true --minify
+rsync -aucz --delete --progress "$siteroot/public/" "$username@$url:$destdir"
-rsync -auvz "$HOME/Workspace/$sitename$construction/public/" "master@$sitename:/var/www/chausse"