ispCP - Board - Support
How to setup a server to follow development? - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: General discussion (/forum-11.html)
+--- Thread: How to setup a server to follow development? (/thread-3198.html)

Pages: 1 2 3 4 5


RE: How to setup a server to follow development? - gOOvER - 05-11-2008 08:58 PM

sci2tech Wrote:But if you are using svn you should remove all folder named .svn

When you use this for checkout, you haven't any .svn dir's:
Code:
svn export -r xxxx http://www.isp-control.net/ispcp_svn/trunk/

xxxx = Trunk Revision

Maybe we can insert an part into the script to export an Trunk Version from SVN. So we can build an complete Nightlyupdate Script.

Quote:
Second, none of template file are copied in /etc. (i think that files from ../parts are mandatory.

Yes, the /parts should also be copied during update.

Maybe we should also integrate an Commandline for the mysql password.

Edit: i create an Wikipage for the Script. When you change something, please do this in the Wiki. Smile

http://www.isp-control.net/documentation/start/scripts/updatenightly


RE: How to setup a server to follow development? - Cube - 05-11-2008 10:37 PM

AFAIR it's not possible to update an export, so you would have to download the whole trunk each time. Therefore checkout is better.
I'm using such a script for months now. But I always look at the changesets and do the changes in the templates and configs manually.


RE: How to setup a server to follow development? - sci2tech - 05-11-2008 10:57 PM

I did what lazy people i`ll do:
Quote:svn checkout http://www.isp-control.net/ispcp_svn/trunk/
from here
Quote:http://www.isp-control.net/ispcp/wiki/releases_svn
Tongue


RE: How to setup a server to follow development? - ispcomm - 05-12-2008 02:46 AM

I updated the script to delete .svn directories in /var/www and to allow for some customization of the directories. Pls. check as I don't use svn and hence .svn directories are not produced in my trunk.

ispcomm.


RE: How to setup a server to follow development? - sci2tech - 05-12-2008 07:21 AM

Tested and it`s ok. But i`m even lazzyer then you Tongue
Quote:#!/bin/sh
#
# ispcp-nightly-update
# Version: 0.0.1
# License: GPL
# Author : ispcomm
# Credits: ispcp development team
# Variables
BACKUPDIR="/var/www/backup"
WWWDIR="/var/www"
ISPCPDIR="${WWWDIR}/ispcp/"
REBUILD_SITES="yes"
TRUNK_DIR="/tmp/svn/"

#download trunk
mkdir -p ${TRUNK_DIR}
svn checkout http://www.isp-control.net/ispcp_svn/trunk/ ${TRUNK_DIR}
cd ${TRUNK_DIR}


# Backup current installation
mkdir -p ${BACKUPDIR}
pushd ${BACKUPDIR}

tar czpf "ispcp_backup-`date +'%Y-%m-%d %H-%M-%S'`.tar.gz" ${WWWDIR}/ispcp/
tar czpf "ispcp_backup-etc-`date +'%Y-%m-%d %H-%M-%S'`.tar.gz" /etc/ispcp/
cp -v ${WWWDIR}/ispcp/engine/ispcp-db-keys.pl .
cp -v ${WWWDIR}/ispcp/gui/include/ispcp-db-keys.php .
cp -v ${WWWDIR}/ispcp/gui/tools/pma/config.inc.php .
popd

# Compile ispcp. Install will copy files to /tmp/ispcp
make clean install

# Update current installation
/etc/init.d/ispcp_daemon stop
pushd /tmp/ispcp${WWWDIR}
cp -vR ispcp/ ${WWWDIR}
find ${ISPCPDIR} -type d -name '.svn' -exec rm -fr '{}' \;
popd

pushd ${BACKUPDIR}
cp -v ispcp-db-keys.pl ${WWWDIR}/ispcp/engine/
cp -v ispcp-db-keys.pl ${WWWDIR}/ispcp/engine/messager/
cp -v ispcp-db-keys.php ${WWWDIR}/ispcp/gui/include/
cp -v config.inc.php ${WWWDIR}/ispcp/gui/tools/pma/
popd

pushd ${WWWDIR}/ispcp/engine/setup/
./set-engine-permissions.sh
./set-gui-permissions.sh
popd

#../parts copying. This must be tuned by someone who know bash better then me. Work only with debian
find /tmp/ispcp/etc/ispcp -type d -name '.svn' -exec rm -fr '{}' \;

bla=`find /tmp/ispcp/etc/ispcp -type d -name 'parts' | awk -F"/" '{print "/"$2"/"$3"/"$4"/"$5"/"$6"/"$7}'`;
for x in $bla
do
bla2=`echo ${x} | awk -F"/" '{print "/"$4"/"$5"/"$6}'`
cp -vR $x $bla2
done

if [ $REBUILD_SITES == "yes" ] ; then
# Some old releases require this. not necessary for current ones.
#DELETE FROM config WHERE name = 'DATABASE_REVISION';
#read -p "Enter mysql pasword on prompt"
cat <<EOF | mysql -uroot -pYOURPASSWORD ispcp
UPDATE mail_users SET status='toadd' where status='ok';
UPDATE domain SET domain_status = 'change' WHERE domain_status = 'ok';
UPDATE domain_aliasses SET alias_status = 'change' WHERE alias_status = 'ok';
UPDATE subdomain SET subdomain_status = 'change' WHERE subdomain_status = 'ok';
EOF

${ISPCPDIR}/engine/ispcp-rqst-mngr
fi
/etc/init.d/ispcp_daemon start
rm -fRv /tmp/ispcp
/etc/init.d/apache2 restart
/etc/init.d/bind9 restart
Worked for me and i have added ../parts/ copy. Now i can update with cron.


RE: How to setup a server to follow development? - ispcomm - 05-12-2008 08:23 PM

sci2tech Wrote:Tested and it`s ok. But i`m even lazzyer then you Tongue
....
Worked for me and i have added ../parts/ copy. Now i can update with cron.
That is being lazy !!! Carefull with the cron as sometime the nightly is broken.

I can't update via cron because I have my own repository where I keep mods and I don't want to pull changes automatically w/out looking at the timeline/diff. Merges are rare but they still occur.

Also few of my parts are different because of some local and historic constraints so I have to do that by hand as well.

ispcomm.


RE: How to setup a server to follow development? - sci2tech - 05-13-2008 03:36 AM

It`s lazy but not crazy. As a matter of facts, it`s searching for trouble becose this force me to learn more. It`s not a productive server, it`s only for playing. I also added
Quote:tar czpf "ispcp_backup-etc-`date +'%Y-%m-%d %H-%M-%S'`.tar.gz" /etc/ispcp/
, if something go wrong i can allways roll back changes. Ispcp database it`s also saved via cron BEFORE runing this cron. I also have a background with vhcs2, and I also want to migrate a server to ispcp. This is a reason for serching for trouble Smile . For thos who may need, this is the script for save all databases from my system
Quote:#!/bin/bash
export d=$(date +"%Y-%m-%d")
export savepath='/home/htdocs/mysql'
mkdir -p $savepath/$d
for a in `echo "show databases" | mysql --defaults-file=/home/sci2tech/.my.cnf -s`;
do
if [ $a != 'mysql' ]; then
if [ $a != 'information_schema' ]; then
mkdir -p $savepath/$d/$a
for i in `echo "show tables" | mysql --defaults-file=/home/sci2tech/.my.cnf -s $a`;
do
mysqldump --defaults-file=/home/sci2tech/.my.cnf --add-drop-table --allow-keywords -q -a -c $a $i > $savepath/$d/$a/$i.sql
done
fi
fi
done
tar -C$savepath -c -j -f$savepath/$d.tar.bz2 $d
rm -rf $savepath/$d
.my.cnf
Quote:[client]
user=USER_USUALY_ROOT
password=YOURPASSWORD
I don`t take credit for this it`s found on net and slightly modified .


RE: How to setup a server to follow development? - gOOvER - 05-14-2008 12:13 PM

Wow, i love the Script. Smile I test it yesterday and it seems to work. I got some Errors at the End of the Script, but i think all is OK.

I used the Version from sci2tech.

Changes in ispcp.conf you have to do by Hand.

WHEN YOU CHANGE SOMETHING AT THE SCRIPT NOW, PLEASE DO THIS IN THE WIKI.


RE: How to setup a server to follow development? - gOOvER - 05-16-2008 01:36 AM

Ok, can someone help me by this Error:

Code:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Forcing reload of web server (apache2)... waiting shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Stopping domain name service...: bind.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Starting domain name service...: bind.

This Error happens at the end of the Script.


RE: How to setup a server to follow development? - kilburn - 05-16-2008 01:44 AM

I think it would be better to store the trunk version in /usr/src, so you only 'svn up' each time instead of downloading the whole tree...