X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=setup-repos.sh;h=b3d91640d5bdd0c6bff286fef2f84a6ccdb91d3c;hp=02c3e4ba8899c972f6677d979d9a0e8c67246195;hb=84e2207412d3c6ea9f940a83b2cdd4503509808a;hpb=5a8c6e01a6f20172fc59699c1d1daffc49f3e5a3 diff --git a/setup-repos.sh b/setup-repos.sh index 02c3e4ba..b3d91640 100755 --- a/setup-repos.sh +++ b/setup-repos.sh @@ -1,8 +1,55 @@ #!/bin/sh -# A little helper script of mine to setup a new development check-out directory +# A little helper script of mine to setup a new development check-out directory. +# This script should be called where you want to create the repository and 'core' +# must be in the same directory. This script is public domain, if it blows up +# your washing maschine or your refrigerator stops working, this script is maybe +# not responsible for this, ask your trusted electrican. Use it on your own risk. -svn co svn+ssh://www.mxchange.org/var/www/svn-repos/blog/ -cd blog -svn mkdir branches tags trunk -svn propset -F ../core/trunk/svn-externals.txt trunk -svn commit -m "Initial import with linked core" +if test "${1}" == ""; then + echo "Usage: ${0} Setup given repository locally." + exit +elif test -e "${1}/.svn/"; then + echo "${0}: Repository ${1} is possibly setup! Aborting..." + exit +fi + +echo "${0}: Checking out ${1} ..." +svn co "svn+ssh://www.mxchange.org/var/www/svn-repos/${1}/" || exit 255 +cd "${1}" +echo "${0}: Creating base directories ..." +svn mkdir branches tags trunk || exit 255 +cd trunk +echo "${0}: Updating skeleton ..." +svn up ../../skel/ || exit 255 +echo "${0}: Importing skeleton repository ..." +svn export --force ../../skel/trunk/ . || exit 255 +svn add * || exit 255 +if test "${1}" != "admin"; then + echo "${0}: Adding directory application/${1} ..." + svn mkdir application/${1} || exit 255 +else + echo "${0}: --- Not creating directory application/${1}. ---" +fi +echo "${0}: Linking to external 'core' repository ..." +svn propset svn:externals -F ../../core/trunk/svn-externals.txt . || exit 255 +if (test "${1}" != "admin" && test "${1}" != "install"); then + cd application/ + if test "${1}" != "qa"; then + svn propset svn:externals -F ../../../core/trunk/application-external.txt . || exit 255 + else + svn propset svn:externals "admin http://www.ship-simu.org/repos/admin/trunk/application/admin/ +install http://www.ship-simu.org/repos/install/trunk/application/install/" . || exit 255 + fi + cd .. # trunk +else + echo "${0}: --- Not setting admin external source. ---" +fi +cd .. # root +echo "${0}: Running commit ..." +svn commit -m "Initial import with linked core from skeleton" || exit 255 +echo "${0}: Updating ..." +svn up +echo "${0}: Exporting repositiory ..." +svn export --force trunk/ /var/www/htdocs/${1} +cd .. # start +echo "${0}: All done."