-
-
Save ahelja/5444860b1aef7f057f08c0922e7bb8d2 to your computer and use it in GitHub Desktop.
Svn import update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sviluppo@dev:~$ cat /usr/local/bin/update_svn_proj.sh | |
#/bin/bash | |
VHOSTSDIR="/var/www/vhosts/"; | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
projectname=$1 | |
vhostpath=$VHOSTSDIR/$projectname | |
svn co --username=<SVNUSERNAME> --password=<SVNPASSWD> --non-interactive --trust-server-cert --no-auth-cache http://localhost/repos/$projectname $vhostpath | |
chown -R www-data:www-data $vhostpath | |
chmod -R g+rw $vhostpath | |
############################################################# | |
cat /usr/local/bin/import_svn_proj.sh | |
#/bin/bash | |
VHOSTSDIR="/var/www/vhosts/"; | |
if [ "$(id -u)" != "0" ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
projectname=$1 | |
vhostpath=$VHOSTSDIR/$projectname | |
svn co --username=<SVNUSERNAME> --password=<SVNPASSWD> --non-interactive --trust-server-cert --no-auth-cache http://localhost/repos/$projectname $vhostpath | |
chown -R www-data:www-data $vhostpath | |
chmod -R g+rw $vhostpath | |
cat /etc/apache2/conf/skel_conf | sed "s/__projectname__/$projectname/g" > /etc/apache2/sites-available/$projectname.conf | |
ln -s /etc/apache2/sites-available/$projectname.conf /etc/apache2/sites-enabled/0001-$projectname.conf | |
service apache2 restart | |
############################################################# | |
cat /etc/apache2/conf/skel_conf | |
<VirtualHost *:80> | |
ServerName __projectname__.dev1.faberadv.com | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/vhosts/__projectname__ | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride All | |
</Directory> | |
<Directory /var/www/vhosts/__projectname__> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
</Directory> | |
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ | |
<Directory "/var/www/cgi-bin"> | |
AllowOverride None | |
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch | |
Order allow,deny | |
Allow from all | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/__projectname__-error_log | |
CustomLog ${APACHE_LOG_DIR}/__projectname__-access_log combined | |
# Possible values include: debug, info, notice, warn, error, crit, | |
# alert, emerg. | |
LogLevel warn | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment