summaryrefslogtreecommitdiff
path: root/.local/bin/upsite
diff options
context:
space:
mode:
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"