]> gitweb.fluxo.info Git - puppet-ikiwiki.git/commitdiff
Deploy also if ikiwiki_src does not exit
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 4 Jan 2014 13:59:16 +0000 (11:59 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 4 Jan 2014 13:59:16 +0000 (11:59 -0200)
templates/deploy.sh.erb
templates/refresh.sh.erb

index cc314017b57a08533cb3ae6ca730a2c316bf77a3..73127da8ce248e86e7e90413fe449042f8af49c9 100644 (file)
@@ -25,26 +25,31 @@ elif [ ! -e "$CONF/$NAME.setup" ]; then
   exit 1
 fi
 
-# Setup source folder
-mkdir -p $SITE/"$INSTANCE"_src_tmp/
-rm -rf $SITE/"$INSTANCE"_src
+# Repository setup
+if [ ! -d "$REPO" ]; then
+  # Setup source folder
+  mkdir -p $SITE/"$INSTANCE"_src_tmp/
+  rm -rf $SITE/"$INSTANCE"_src
 
-# Create initial page
-echo "Welcome to your new wiki powered by [ikiwiki](http://ikiwiki.info)." > $SITE/"$INSTANCE"_src_tmp/index.mdwn
+  # Create initial page
+  echo "Welcome to your new wiki powered by [ikiwiki](http://ikiwiki.info)." > $SITE/"$INSTANCE"_src_tmp/index.mdwn
 
-# Create ikiwiki repository
-ikiwiki-makerepo git $SITE/"$INSTANCE"_src_tmp $REPO
+  # Create ikiwiki repository
+  ikiwiki-makerepo git $SITE/"$INSTANCE"_src_tmp $REPO
+fi
 
 # Clone it again
-git clone $REPO $SITE/"$INSTANCE"_src
-
-# Fix remotes
-cd $SITE/"$INSTANCE"_src
-git remote rm origin
-git remote add origin $REMOTE
-git config branch.master.remote origin
-git config branch.master.merge refs/heads/master
-cd $CWD
+if [ ! -d "$SITE"/"$INSTANCE"_src ]; then
+  git clone $REPO $SITE/"$INSTANCE"_src
+
+  # Fix remotes
+  cd $SITE/"$INSTANCE"_src
+  git remote rm origin
+  git remote add origin $REMOTE
+  git config branch.master.remote origin
+  git config branch.master.merge refs/heads/master
+  cd $CWD
+fi
 
 # Cleanup
 rm -rf $SITE/"$INSTANCE"_src_tmp
index 6ef0b7dffc612a8b41b0a628cd9c5db68da195e7..7561311f85923e1f66ee9b723959b59ba32122db 100644 (file)
@@ -26,7 +26,7 @@ elif [ ! -e "$CONF/$NAME.setup" ]; then
 fi
 
 # Deploy if needed
-if [ ! -d "$REPO" ]; then
+if [ ! -d "$REPO" ] || [ ! -d "$SITE"/"$INSTANCE"_src ]; then
   ikiwiki-deploy $NAME $OWNER $GROUP
 fi