Svn deployment issu

how can svn be deployed to the same site with two domain names, one for the official domain name and one for the test domain name, and then by submitting an automatic update to the test domain name, the testable official domain name needs to go to the server for update before it can be launched to the official domain name? The problem now is that there is only one site but the secondary development process does not want to affect the online code.

Jun.24,2022

the same code is deployed into different services, and then the test and formal domain names are resolved to the corresponding service address through configuration. The test environment can use scripts to trigger automatic deployment.


SVN also has a hook hook , for example, post-commit is triggered when commit . Your question is how the hook triggers the pull operation.

according to your problem description, if SVN SERVER is on the same server as the test site, then post-commit can be easily solved, that is,

create a post-commit file in the hooks/ directory of the project library, which is roughly as follows:
-sharp!/usr/bin/env bash

set -e

SITE_PATH=$(dirname $(dirname "$0"))
USER=$(whoami)
cd $SITE_PATH
git reset --hard origin/master
git clean -f
git pull
git checkout master
chown -R $USER $SITE_PATH
Menu