Thursday, January 28, 2016

WSO2 SVN Based Deployment Synchronizer

Refer: https://docs.wso2.com/display/CLUSTER420/Configuring+Deployment+Synchronizer

Download SVNKit (svnkit-1.3.9.wso2v2.jar) from http://dist.wso2.org/tools/svnkit-1.3.9.wso2v2.jar and install it by copying it into the <PRODUCT_HOME>/repository/components/dropins folder.

Download http://maven.wso2.org/nexus/content/groups/wso2-public/com/trilead/trilead-ssh2/1.0.0-build215/trilead-ssh2-1.0.0-build215.jar and copy it to the <PRODUCT_HOME>/repository/components/lib folder. This .jar file is necessary for the SVNKit to work as expected.

Create repo location on svn
svn mkdir https://svn.example.com/depsync.repo/

Enable dep sync on master node
<DeploymentSynchronizer>
    <Enabled>true</Enabled>
    <AutoCommit>true</AutoCommit>
    <AutoCheckout>true</AutoCheckout>
    <RepositoryType>svn</RepositoryType>
    <SvnUrl>https://svn.example.com/depsync.repo/</SvnUrl>
    <SvnUser>repouser</SvnUser>
    <SvnPassword>repopassword</SvnPassword>
    <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
</DeploymentSynchronizer>


Enable dep sync on worker node
<DeploymentSynchronizer>
    <Enabled>true</Enabled>
    <AutoCommit>false</AutoCommit>
    <AutoCheckout>true</AutoCheckout>
    <RepositoryType>svn</RepositoryType>
    <SvnUrl>https://svn.example.com/depsync.repo/</SvnUrl>
    <SvnUser>repouser</SvnUser>
    <SvnPassword>repopassword</SvnPassword>
    <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
</DeploymentSynchronizer>


When we start the server it starts dep sync process and creates .svn folders in <HOME>/repository/deployment/server

If you want to change the location of the repo:
Update the repo path in carbon.xml file
Delete all the .svn files in <HOME>/repository/deployment/server location
find . -name .svn |xargs rm -rf
Restart the server

Deployment Synchronizer happens in 15 seconds frequency. You can change it updating  <DeploymentUpdateInterval>15</DeploymentUpdateInterval> property in carbon.xml.


No comments: