]> gitweb.fluxo.info Git - scripts.git/commitdiff
Sandbox: ikiwiki support
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 20 Jun 2015 14:06:38 +0000 (11:06 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 20 Jun 2015 14:06:38 +0000 (11:06 -0300)
TODO.md
sandbox

diff --git a/TODO.md b/TODO.md
index 8ab655d36fa3eef112b989755ec94ea48510f2d9..b106e2641bbf5740192d7731dbd0f66e84409493 100644 (file)
--- 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 83428112fb7d7c8beaef305bdd95b345dd610dc0..0ad80e7827128e3fdf45c2cd8c8fc2a608c127d7 100755 (executable)
--- 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