summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas <dr@jones.dk>2013-11-13 12:01:09 +0100
committerJonas <dr@jones.dk>2013-11-13 12:01:09 +0100
commit84642382812c4242bb4a4f57a7fdb004bc7c7b7a (patch)
tree109e891c06a3c8514a27b9afc39f26bf7db3b48f
parentd948d138bd2404fa1fa7bf16343fc4fba40e36cb (diff)
Add new script localikiblogcreate.
-rwxr-xr-xlocalikiblogcreate56
1 files changed, 56 insertions, 0 deletions
diff --git a/localikiblogcreate b/localikiblogcreate
new file mode 100755
index 0000000..c80475f
--- /dev/null
+++ b/localikiblogcreate
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# /usr/local/bin/localwebresolve
+# Copyright 2013 Jonas Smedegaard <dr@jones.dk>
+#
+# Bootstrap Ikiwiki-based blog site
+#
+
+set -e
+
+BLOGGITDIR=~/private_git/blog
+BLOGWORKDIR=~/private_webdata/blog
+BLOGWORKDIR=~/public_html
+BLOGPROTO=http
+BLOGHOST=user.homebase.dk
+
+# The above can be overridden
+LOCALCONFIG=/etc/local/webresolve.conf
+. $LOCALCONFIG || true
+
+gitdir="$BLOGGITDIR"
+workdir="$BLOGWORKDIR"
+webdir="$BLOGWORKDIR"
+baseurl="${1:BLOGHOST://$BLOGHOST/~$USER}"
+
+# clone/create public repositories
+mkdir -p $gitdir
+git clone --bare git://source.jones.dk/ikiwiki/site $gitdir.git
+git init --bare $gitdir/content.git
+
+# clone/create private working repositories
+mkdir -p ~/private_data
+git clone --recursive $gitdir.git $workdir
+git clone $gitdir/content.git $workdir/content
+
+# populate content
+cd $workdir/content
+rsync -av /usr/share/ikiwiki/examples/blog/ .
+git add .
+git commit -m "Initial commit, from sample blog."
+git push
+
+# redirect compiled blog to public folder
+mkdir -p $workdir/build
+ln -s $webdir $workdir/build/html
+ln -s $webdir $workdir/build/cgi
+
+# Customize settings and bootstrap
+echo "# IkiWiki::Setup::Yaml" > $workdir/config/ikiwiki.setup.in
+echo "url: $baseurl" >> $workdir/config/ikiwiki.setup.in
+echo "cgiurl: $baseurl/ikiwiki.cgi" >> $workdir/config/ikiwiki.setup.in
+echo "theme: goldtype" >> $workdir/config/ikiwiki.setup.in
+make -C $workdir init
+
+# initialize blog
+make -C $workdir