diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2015-10-02 12:03:29 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2015-10-02 12:03:29 +0200 |
commit | 303856158b052715367248c9a868c7fd7defb197 (patch) | |
tree | 424f5f3b05b4dbeed5c2b66fa7ae19278c91ec73 | |
parent | 9e1f72647ffcb7929c666cf453b29497ce606f65 (diff) | |
download | norsk-urskog-main-303856158b052715367248c9a868c7fd7defb197.tar.gz norsk-urskog-main-303856158b052715367248c9a868c7fd7defb197.tar.bz2 norsk-urskog-main-303856158b052715367248c9a868c7fd7defb197.zip |
Make deploy script a bit better.
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | deploy.sh | 58 |
2 files changed, 58 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d7d3aa1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +deploy_*.rc @@ -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 |