svn文件同步到web服务器,即同步到网站根目录

进入到hooks目录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[root@li538-34 default] # cd /opt/svn
[root@li538-34 svn] # ll
total 4
drwxr-xr-x 6 root root 4096 Feb 24 06:38 repos
[root@li538-34 svn] # cd repos
[root@li538-34 repos] # ll
total 24
drwxr-xr-x 2 root root 4096 Feb 24 07:47 conf
drwxr-sr-x 6 root root 4096 Feb 24 08:01 db
-r--r--r-- 1 root root    2 Feb 24 06:31  format
drwxr-xr-x 2 root root 4096 Feb 24 07:24 hooks
drwxr-xr-x 2 root root 4096 Feb 24 06:31 locks
-rw-r--r-- 1 root root  229 Feb 24 06:31 README.txt
[root@li538-34 repos] # cd hook
- bash cd : hook: No such  file  or directory
[root@li538-34 repos] # cd hooks
[root@li538-34 hooks] # ll
total 40
-rwxrwxrwx 1 root root  138 Feb 24 07:21 post-commit
-rw-r--r-- 1 root root 1977 Feb 24 06:31 post-commit.tmpl
-rw-r--r-- 1 root root 1638 Feb 24 06:31 post-lock.tmpl
-rw-r--r-- 1 root root 2289 Feb 24 06:31 post-revprop-change.tmpl
-rw-r--r-- 1 root root 1567 Feb 24 06:31 post-unlock.tmpl
-rw-r--r-- 1 root root 3426 Feb 24 06:31 pre-commit.tmpl
-rw-r--r-- 1 root root 2410 Feb 24 06:31 pre-lock.tmpl
-rw-r--r-- 1 root root 2786 Feb 24 06:31 pre-revprop-change.tmpl
-rw-r--r-- 1 root root 2100 Feb 24 06:31 pre-unlock.tmpl
-rw-r--r-- 1 root root 2780 Feb 24 06:31 start-commit.tmpl
[root@li538-34 hooks] #

正常情况下没有post-commit 文件,我这里已经添加了。

post-commit 文件代码

1
2
3
4
5
6
#!/bin/sh
export  LANG=zh_CN.UTF-8
WEB= /home/wwwroot/default
svn update $WEB --username ningyuqiao --password ningyuqiao --no-auth-cache
~                                                                                                                                                                                              
~

包括网站根目录,svn一个用户名和密码。

然后给post-commit 执行权限,我直接给了777。

然后进入网站根目录

1
svn checkout svn: //  ip address   .    #输入ip地址,然后注意后面有个.代表当前目录

到此为止基本搞定,大家有问题给我留言。





      本文转自ning1022 51CTO博客,原文链接:http://blog.51cto.com/ning1022/1615070,如需转载请自行联系原作者




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值