git-server-docker-stagit

git-server-with-stagit
git clone git://git.andersuno.nu/git-server-docker-stagit.git
Log | Files | Refs | README

new-repo (835B)


      1 #!/bin/sh
      2 [ -z "$1" ] && echo "No name provided" && echo "new-repo <name> <desc>" && exit 1
      3 [ -z "$2" ] && echo "No description provided" && echo "new-repo <name> <desc>" && exit 1
      4 
      5 mkdir -p /git-server/repos/"$1".git
      6 cd /git-server/repos/"$1".git || exit 1
      7 git init --bare
      8 touch git-daemon-export-ok
      9 echo "$2" > ./description
     10 echo "git://git.andersuno.nu/$1.git" > ./url
     11 echo "andersuno" > ./owner
     12 echo "cd /git-server/public-html/$1 && stagit /git-server/repos/$1.git" > ./hooks/post-update
     13 echo "find /git-server/repos/ -type d -name \*.git | sort | xargs stagit-index > /git-server/public-html/index.html" >> ./hooks/post-update
     14 chmod +x ./hooks/post-update
     15 
     16 mkdir -p /git-server/public-html/"$1"
     17 cd /git-server/public-html/"$1" || exit 1
     18 ln -sf ../favicon.png favicon.png
     19 ln -sf ../logo.png logo.png
     20 ln -sf ../style.css style.css