Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7014299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:30:11+00:00 2026-05-27T22:30:11+00:00

I have been reading for a while and got a few answers, but I

  • 0

I have been reading for a while and got a few answers, but I just need some more help.

I am trying to automatically deploy a website when a certain change set is committed to a branch, so I release my different versions from different branches. For example, there is a live branch that whenever is updated, the new change sets are merged into the the current live website.

My repository (on a Subversion version control system) is on the same server as the live server, so all I need to do is to transfer the files to a different directory.

I know I need to edit repo/hooks/post-commit file, and I have got this working, however I am not sure on the contents of this file to do what I need to do.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:30:12+00:00Added an answer on May 27, 2026 at 10:30 pm

    Do not use hooks for deployment purposes. Use build tool (Ant, Maven, whatever) and continuous integration tool (CruiseControl, CruiseControl.rb, Hudson, etc). Using hooks is just wrong because of the several reasons:

    1. Scaling. Hooks do not scale. It is difficult to make hook script do what they are not supposed to as, for example, deployment, which always requires some tricks to perform successfully.
    2. Flexibility. Hooks are not flexible enough. You need to rewrite them every time there are changes in your processes. And your corrections might break something you managed to do with hooks previously.
    3. Security. Are you going to store login/password for ftp/ssh deployment directly in your hook? That will be a huge mistake. You might find workaround, but it will be no good either as long as hooks are not the place for security management.
    4. Complexity. Deployment usually requires a lot of specific actions to do even when at first it seems that it does not. If you start to do deployment in your hook scripts, they will turn out to be swollen and unmanageable.
    5. Source control. You cannot put hooks under source control. If you will try to put it under source control, you will definitely regret it later as long as it is difficult to store hooks together with your project sources, in one place.

    All you need to is to:

    1. Write build script where you describe your deployment steps
    2. Install continuous integration tool
    3. Make continuous integration tool use your build script and repository
    4. Configure continuous integration tool to perform build on commit
    5. Perform commit to the repository and see how your changes will be automatically built & deployed according to the build script you’ve written.

    Personally I use Ant and CruiseControl.rb for the purpose you’ve described.
    Here is the example of build script to deploy my changes over ftp protocol:

    <?xml version="1.0"?>
    <project name="myproject" default="deploy-local">
        <property file="build.properties"/>
        <target name="deploy-local">
            <echo message="Deploying version ${version}" />
            <delete dir="${deploy.path.local}" />
            <copy todir="${deploy.path.local}">
                <fileset dir="." includes="**/*" >
                    <exclude name=".svn/**" />
                    <exclude name="build.*" />
                </fileset>
            </copy>
        </target>
        <target name="deploy-remote">
            <echo message="Deploying project" />
            <ftp action="del"
                 server="${deploy.remote.server}" 
                 userid="${deploy.remote.login}"
                 password="${deploy.remote.pass}">
                <fileset>
                  <include name="${deploy.path.remote}"/>
                </fileset>
            </ftp>
            <ftp action="mkdir"
                 server="${deploy.remote.server}" 
                 userid="${deploy.remote.login}"
                 password="${deploy.remote.pass}"
                 remotedir="${deploy.path.remote}">
            </ftp>
            <ftp server="${deploy.remote.server}" 
                 userid="${deploy.remote.login}"
                 password="${deploy.remote.pass}"
                 remotedir="${deploy.path.remote}"
                 passive="yes">
                 <fileset dir="." includes="**/*" >
                    <exclude name=".svn/**" />
                    <exclude name="build.*" />
                </fileset>
            </ftp>
        </target>
    </project>
    

    build.properties file has following content:

    deploy.path.local = C:\\apache\\htdocs\\myproject
    deploy.path.remote = /http/deploy
    deploy.remote.server = ftp.myproject.com
    deploy.remote.login = mylogin
    deploy.remote.pass = mypass
    

    I would recommend spending some time to learn basics of build management (Ant) and continuous integration (CruiseControl) to perform deployment in a most appropriate fashion. Even though it might seem to be not what you requested and little bit more complex, it is a right thing to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been reading about Scala for a while and even wrote some small
I have been reading for a while regarding Hibernate but I can't seem to
I have been reading up on multiple PHP frameworks, especially the Zend Framework but
I have been following javascript tutorial from www.w3school.com and while reading one of the
I have been reading StackOverflow for a while and now I have a question
I have been reading up on maps and understand some of the differences in
I have been programming in C++ for a while but I am a beginner
I have been reading some of the perl513*delta files and I have seen some
I have been reading about streams, but when I try and deviate from the
Well I have been reading quite a lot sources but they differ in definiton:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.