aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-06-20 11:06:38 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-06-20 11:06:38 -0300
commita29a044d6d6eed23350599e8eeeea53ae11302d5 (patch)
tree3f23b7c9d5ed4136c3a7c94e2ff601bbf664dfcd
parent816e938e3cb2bf214a692deef47ce897d8748b26 (diff)
downloadscripts-a29a044d6d6eed23350599e8eeeea53ae11302d5.tar.gz
scripts-a29a044d6d6eed23350599e8eeeea53ae11302d5.tar.bz2
Sandbox: ikiwiki support
-rw-r--r--TODO.md7
-rwxr-xr-xsandbox38
2 files changed, 43 insertions, 2 deletions
diff --git a/TODO.md b/TODO.md
index 8ab655d..b106e26 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,4 +1,9 @@
TODO
====
-* Nothing here? :P
+* Better sandbox template
+ * Should be indepotent.
+ * Asking whether to setup:
+ * Vagrant.
+ * Ikiwiki.
+ * Etc.
diff --git a/sandbox b/sandbox
index 8342811..0ad80e7 100755
--- a/sandbox
+++ b/sandbox
@@ -10,6 +10,7 @@ CODE="$HOME/code"
PROJECT="$1"
REPO="$2"
BOOTSTRAP="git://git.sarava.org/puppet-bootstrap.git"
+TEMPLATES="git://git.sarava.org/templates.git"
# Syntax check
if [ -z "$PROJECT" ]; then
@@ -58,6 +59,41 @@ else
)
fi
+# Ikiwiki integration
+(
+ if [ ! -d "$HOME/file/templates" ]; then
+ echo "Please clone $TEMPLATES into $HOME/file/templates"
+ else
+ echo ""
+ echo "Setting up ikiwiki integration..."
+ cd $CODE/$PROJECT
+ git checkout develop
+
+ cat $HOME/file/templates/ikiwiki/.gitignore >> .gitignore
+
+ if [ ! -e "index.mdwn" ]; then
+ cp $HOME/file/templates/ikiwiki/index.mdwn .
+ fi
+
+ if [ ! -e "Makefile" ]; then
+ cp $HOME/file/templates/ikiwiki/Makefile .
+ elif ! grep -q ^wiki: Makefile; then
+ grep -v '^#' $HOME/file/templates/ikiwiki/Makefile >> Makefile
+ fi
+
+ if [ ! -d "templates" ]; then
+ cp r $HOME/file/templates/ikiwiki/templates .
+ fi
+
+ if [ ! -d "bootstrap" ]; then
+ cp r $HOME/file/bootstrap/ikiwiki/bootstrap .
+ fi
+
+ git add .
+ git commit -a -m "Static site generation support using ikiwiki"
+ fi
+)
+
# Vagrant integration
(
echo ""
@@ -65,7 +101,7 @@ fi
cd $CODE/$PROJECT
git checkout develop
echo '.vagrant' >> .gitignore
- git commit -a -m "Dev branch with vagrant support"
+ git commit -a -m "Adds vagrant support"
# Use the best approach
#git clone $BOOSTRAP $CODE/$PROJECT/puppet