diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/deploy.sh.erb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/templates/deploy.sh.erb b/templates/deploy.sh.erb index 7fa4103..34064d7 100644 --- a/templates/deploy.sh.erb +++ b/templates/deploy.sh.erb @@ -5,7 +5,8 @@ INSTANCE="$2" BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>" SITE=$BASE/$NAME CONF="/etc/ikiwiki" -REPO="/var/git/repositories/$NAME.git" +REPO_OWNER="<%= scope.lookupvar('ikiwiki::git_implementation') %>" +REPO="$REPO_OWNER@localhost:$NAME" if [ -z "$INSTANCE" ]; then echo "Usage:`basename $0` <site> <instance>" @@ -18,11 +19,11 @@ if [ ! -e "$CONF/$NAME.setup" ]; then fi # Setup source folder -mkdir -p $SITE/"$INSTANCE"_src/ +mkdir -p $SITE/"$INSTANCE"_src/ $SITE/"$INSTANCE"_src_tmp/ # Create initial page -if [ ! -e $SITE/"$INSTANCE"_src/index.mdwn ]; then - echo > $SITE/"$INSTANCE"_src/index.mdwn <<EOF +if [ ! -e $SITE/"$INSTANCE"_src_tmp/index.mdwn ]; then + echo > $SITE/"$INSTANCE"_src_tmp/index.mdwn <<EOF Welcome to your new wiki. All wikis are supposed to have a [[SandBox]], so this one does too. @@ -35,8 +36,8 @@ fi # Create ikiwiki instance if [ ! -d "$REPO" ]; then - ikiwiki-makerepo git $SITE/"$INSTANCE"_src/ $REPO - touch $REPO/git-daemon-export-ok + ikiwiki-makerepo git $SITE/"$INSTANCE"_src_tmp $SITE/"$INSTANCE"_src + rm -rf $SITE/"$INSTANCE"_src_tmp ( cd $REPO/$NAME.git && git --bare update-server-info ) - ( cd $SITE/"$INSTANCE"_src && git remote rm origin && git remote add origin gitolite@localhost:$INSTANCE ) + ( cd $SITE/"$INSTANCE"_src && git remote rm origin && git remote add origin $REPO) fi |