diff options
-rw-r--r-- | TODO.md | 7 | ||||
-rwxr-xr-x | sandbox | 38 |
2 files changed, 43 insertions, 2 deletions
@@ -1,4 +1,9 @@ TODO ==== -* Nothing here? :P +* Better sandbox template + * Should be indepotent. + * Asking whether to setup: + * Vagrant. + * Ikiwiki. + * Etc. @@ -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 |