Web directory:/hoem/www/project
SVN repository directory:/svn/project
1.cd/svn/project/hooks
2. New Post-commit, perform vim post-commit content as follows
#!/bin/sh repos= "$" rev= "$"
dir= "/home/www/project"
export Lang=en_us. UTF-8
curdate= ' date '
echo "Code Deployed by at $CURDATE, $REPOS, $REV" >>/svn/code_deploy.log
SVN Update $DIR--username admin--password 123456
Then
chmod +x Post-commit
3. To/HOME/WWW under Checkout project
SVN checkout svn://127.0.0.1/project/
When this step is accepted, submitting the code update on the customer service will automatically sync to the Web directory.
Attached SVN hook type
Server hooks:
There are 9 types of hooks on the SVN server, namely:
A. 2 Types of Locks
A1.pre-lock
Execute the script before locking the file
A2.post-lock
Execute the script after the file is locked
B. 2 Types of Unlocked
B1.pre-unlock
Execute the script before unlocking the file
B2.post-unlock
Execute the script after unlocking the file
c. 3 types of submissions
C1.start-commit
Executes the script before the client has yet to submit data to the server, that is, before the Subversion transaction (abbreviated as TXN) has been established
C2.pre-commit
After Subversion transaction is complete, execute the script before committing
C3.post-commit
After the commit is completed, the hook is executed after the version is successfully created, the commit is completed and cannot be changed, so the return value of this script is ignored.
D. 2 types of attributes
D1.pre-revprop-change
Execute the script before modifying the revision property
D2.post-revprop-change
After modifying the revision property, execute the script. Because the revision is completed and cannot be changed, the return value of this script is ignored (although the actual implementation seems to be that the correct execution of the script affects the property modification)
Client hooks:
The Tortoise SVN client has 6 hooks, respectively:
A. With regard to submissions
A1.start Commit Hook
A2.pre-commit Hook
A3.post-commit Hook
B. With regard to the updated
B1.start Update Hook
B2.pre-update Hook
B3.post-update Hook