summaryrefslogtreecommitdiffstats
path: root/deploy.sh
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-10-02 12:03:29 +0200
committerHarald Eilertsen <haraldei@anduin.net>2015-10-02 12:03:29 +0200
commit303856158b052715367248c9a868c7fd7defb197 (patch)
tree424f5f3b05b4dbeed5c2b66fa7ae19278c91ec73 /deploy.sh
parent9e1f72647ffcb7929c666cf453b29497ce606f65 (diff)
downloadnorsk-urskog-main-303856158b052715367248c9a868c7fd7defb197.tar.gz
norsk-urskog-main-303856158b052715367248c9a868c7fd7defb197.tar.bz2
norsk-urskog-main-303856158b052715367248c9a868c7fd7defb197.zip
Make deploy script a bit better.
Diffstat (limited to 'deploy.sh')
-rwxr-xr-xdeploy.sh58
1 files changed, 57 insertions, 1 deletions
diff --git a/deploy.sh b/deploy.sh
index 4e9436c..a0b8f29 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -1,2 +1,58 @@
#! /bin/bash
-scp -r blog/_site/* volse.anduin.net:/usr/local/www/norsk-urskog/beta
+#
+# Deploy site to target server
+#
+# Usage
+# -----
+#
+# Create a file named "deploy_target.rc" in the same directory where
+# this script is located. It should contain the following content:
+#
+# deploy_to_path=user@server:/path/to/site
+#
+# This will be sourced by this script to configure where you want to
+# deploy the site.
+#
+# Deploy using this invocation:
+#
+# ./deploy target
+#
+# Where target is the same as in the file name above. If no target is
+# specified, the target "beta" is used by default.
+#
+# License
+# -------
+# Copyright (C) 2015 Harald Eilertsen
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+target=$1
+if [[ -z $target ]];
+then
+ target="beta"
+fi
+
+echo "** Building site:"
+pushd blog
+jekyll build
+buildres=$?
+popd
+
+source "deploy_$target.rc"
+
+if [[ $buildres == 0 ]];
+then
+ echo "** Deploying to: $deploy_to_path"
+ scp -r blog/_site/* $deploy_to_path
+fi