فهرست منبع

:hammer: hugo build scripts

Jeremy Zheng 2 سال پیش
والد
کامیت
2587a47082
1فایلهای تغییر یافته به همراه25 افزوده شده و 0 حذف شده
  1. 25 0
      scripts/ops/hugo.sh

+ 25 - 0
scripts/ops/hugo.sh

@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -e
+
+if [ "$#" -ne 2 ]
+then
+  echo "USAGE: $0 DOMAIN REPO"
+  exit 1
+fi
+
+export WORKSPACE=/var/www/$1
+
+if [ ! -d $WORKSPACE/repo.git ]
+then
+  git clone $2 $WORKSPACE/repo.git
+fi
+
+cd $WORKSPACE/repo.git
+git pull
+git submodule update --init --recursive
+hugo -d $WORKSPACE/htdocs
+
+echo "done."
+exit 0
+