Naming convention applied on class templates
[core.git] / setup-repos.sh
1 #!/bin/sh
2 # A little helper script of mine to setup a new development check-out directory
3
4 if test "$1" == ""; then
5         echo "Usage: $0 <repos> Setup given repository locally."
6         exit
7 elif test -e "$1/.svn/"; then
8         echo "$0: Repository $1 is possibly setup! Aborting..."
9         exit
10 fi
11
12 echo "$0: Checking out $1 ..."
13 svn co svn+ssh://www.mxchange.org/var/www/svn-repos/$1/ || exit 255
14 cd $1
15 echo "$0: Creating base directories ..."
16 svn mkdir branches tags trunk || exit 255
17 cd trunk
18 echo "$0: Updating skeleton ..."
19 svn up ../../skel/ || exit 255
20 echo "$0: Importing skeleton repository ..."
21 svn export --force ../../skel/trunk/ . || exit 255
22 svn add * || exit 255
23 if test "$1" != "admin"; then
24         echo "$0: Adding directory application/$1 ..."
25         svn mkdir application/$1 || exit 255
26 else
27         echo "$0: --- Not creating directory application/$1. ---"
28 fi
29 echo "$0: Linking to external 'core' repository ..."
30 svn propset svn:externals -F ../../core/trunk/svn-externals.txt . || exit 255
31 if (test "$1" != "admin" && test "$1" != "install"); then
32         cd application/
33         if test "$1" != "qa"; then
34                 svn propset svn:externals -F ../../../core/trunk/application-external.txt . || exit 255
35         else
36                 svn propset svn:externals "admin http://www.ship-simu.org/repos/admin/trunk/application/admin/ 
37 install http://www.ship-simu.org/repos/install/trunk/application/install/" . || exit 255
38         fi
39         cd .. # trunk
40 else
41         echo "$0: --- Not setting admin external source. ---"
42 fi
43 cd .. # root
44 echo "$0: Running commit ..."
45 svn commit -m "Initial import with linked core from skeleton" || exit 255
46 echo "$0: Updating ..."
47 svn up
48 echo "$0: Exporting repositiory ..."
49 svn export --force trunk/ /var/www/htdocs/$1
50 cd .. # start
51 echo "$0: All done."