Current time: 12-24-2024, 08:58 AM Hello There, Guest! (LoginRegister)


Post Reply 
How to setup a server to follow development?
Author Message
gOOvER Offline
Banned

Posts: 3,561
Joined: Jul 2007
Post: #11
RE: How to setup a server to follow development?
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...atenightly
(This post was last modified: 05-11-2008 09:22 PM by gOOvER.)
05-11-2008 08:58 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Cube Offline
Member
***

Posts: 740
Joined: Apr 2007
Reputation: 9
Post: #12
RE: How to setup a server to follow development?
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.
05-11-2008 10:37 PM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #13
RE: How to setup a server to follow development?
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
05-11-2008 10:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ispcomm Offline
Junior Member
*

Posts: 93
Joined: Apr 2008
Reputation: 3
Post: #14
RE: How to setup a server to follow development?
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.
05-12-2008 02:46 AM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #15
RE: How to setup a server to follow development?
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.
(This post was last modified: 05-16-2008 03:14 AM by sci2tech.)
05-12-2008 07:21 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ispcomm Offline
Junior Member
*

Posts: 93
Joined: Apr 2008
Reputation: 3
Post: #16
RE: How to setup a server to follow development?
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.
05-12-2008 08:23 PM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #17
RE: How to setup a server to follow development?
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 .
(This post was last modified: 05-13-2008 03:37 AM by sci2tech.)
05-13-2008 03:36 AM
Visit this user's website Find all posts by this user Quote this message in a reply
gOOvER Offline
Banned

Posts: 3,561
Joined: Jul 2007
Post: #18
RE: How to setup a server to follow development?
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.
(This post was last modified: 05-14-2008 12:44 PM by gOOvER.)
05-14-2008 12:13 PM
Visit this user's website Find all posts by this user Quote this message in a reply
gOOvER Offline
Banned

Posts: 3,561
Joined: Jul 2007
Post: #19
RE: How to setup a server to follow development?
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.
05-16-2008 01:36 AM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #20
RE: How to setup a server to follow development?
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...
05-16-2008 01:44 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)