部署任务:
机器1 192.168.100.231, os: CentOS release 3.6 (Final),装上apache2.3.6+mongrel cluster
机器2 192.168.100.234, os: CentOS release 4.3 (Final) 装上 mongrel cluster
set
:application
,
"
space
"
set
:repository
,
"
http://192.168.100.212:3690/repo/moxtv/branches/space
"
set
:svn_username
,
"
weip
"
set
:svn_password
,
"
weip
"
#
If
you aren't deploying to
/
u
/
apps
/#
{application}
on
the target
#
servers
(
which is the default
),
you can specify the actual location
#
via the
:deploy_to
variable:
#
set
:deploy_to
,
"
/var/www/#{application}
"
#
If
you aren't using Subversion to manage your source code
,
specify
#
your SCM below:
#
set
:scm
,
:subversion
set
:use_sudo
,
false
set
:deploy_to
,
"
/var/www/webapps/#{application}
"
set
:user
,
"
root
"
set
:password
,
"
secretpa
"
role
:app
,
"
192.168.100.231
"
,
"
192.168.100.234
"
#
new
0
role
:web
,
"
192.168.100.231
"
role
:db
,
"
192.168.100.231
"
,
:primary
=>
true
task
:chmod
,
:roles
=>
:web
do
run
"
chmod -fR 755 #{deploy_to}/current/script/*
"
end
after
"
deploy:symlink
"
,
:chmod
default_environment[
"
PATH
"
]
=
"
/usr/local/ruby2/bin:/usr/local/apache2.2.6/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/ruby/bin:/usr/local/ant/bin:/usr/java/jdk1.5.0_05/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
"
#
new
1
set
:mongrel_conf
,
"
#{current_path}/config/mongrel_cluster.yml
"
set
:mongrel_port
,
"
4000
"
set
:mongrel_nodes
,
"
4
"
#
new
2
namespace
:deploy
do
task
:start
,
:roles
=>
:app
do
run
"
cd #{current_path} && mongrel_rails cluster::configure -e production -p #{mongrel_port} -N #{mongrel_nodes} -c #{current_path}
"
run
"
cd #{current_path} && mongrel_rails cluster::start
"
#
run
"
rm -rf /home/#{user}/public_html;ln -s #{current_path}/public /home/#{user}/public_html
"
run
"
mkdir -p #{deploy_to}/shared/config
"
run
"
mv #{current_path}/config/mongrel_cluster.yml #{deploy_to}/shared/config/mongrel_cluster.yml
"
run
"
ln -s #{deploy_to}/shared/config/mongrel_cluster.yml #{current_path}/config/mongrel_cluster.yml
"
run
"
apachectl start
"
end
end
#
new
3
namespace
:deploy
do
task
:restart
,
:roles
=>
:app
do
run
"
ln -s #{deploy_to}/shared/config/mongrel_cluster.yml #{current_path}/config/mongrel_cluster.yml
"
run
"
cd #{current_path} && mongrel_rails cluster::restart
"
run
"
apachectl restart
"
end
end
205




被折叠的 条评论
为什么被折叠?



