Publish to live site from Subversion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?windows-1252?Q?=22=C1lvaro_G=2E_Vicario=22?=

    Publish to live site from Subversion

    I’ve been using Subversion for a while to maintain the PHP web apps and
    sites I develop in my Windows box. But when I want to publish a new
    release I update the live site manually and I want to improve this process.

    I can’t simply export to a fresh directory and upload all files because
    that won’t handle renames and deletions (and the upload will take
    forever anyway). I typically use WinMerge to find out what files changed
    but there’re some drawbacks:

    * It can’t compare files through FTP (and if it could, I guess it’d need
    to download the whole site every time) so I need to maintain a local
    copy of the live site and upload files manually.

    * It can’t use the repository information so it won’t ignore
    non-versioned items (settings, uploads, caches, data…) unless I maintain
    a separate filter duplicating the svn:ignore data.

    I could keep my current method and write a bunch of Subversion hook
    scripts in PHP (I’m not proficient in any other language available) to
    keep the data in synch but I looks like a overwhelming effort that can
    easily break. So I wonder how is everyone else doing it. But according
    to my googling the answer is: writing lots of custom scripts!

    Is it the only way? Is there a tool to help with this common task? Can
    Apache Ant be used for this? How do *you* do it?



    --
    -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
    -- Mi sitio sobre programación web: http://bits.demogracia.com
    -- Mi web de humor al baño María: http://www.demogracia.com
    --
  • Jerry Stuckle

    #2
    Re: Publish to live site from Subversion

    Álvaro G. Vicario wrote:
    I’ve been using Subversion for a while to maintain the PHP web apps and
    sites I develop in my Windows box. But when I want to publish a new
    release I update the live site manually and I want to improve this process.
    >
    I can’t simply export to a fresh directory and upload all files because
    that won’t handle renames and deletions (and the upload will take
    forever anyway). I typically use WinMerge to find out what files changed
    but there’re some drawbacks:
    >
    * It can’t compare files through FTP (and if it could, I guess it’d need
    to download the whole site every time) so I need to maintain a local
    copy of the live site and upload files manually.
    >
    * It can’t use the repository information so it won’t ignore
    non-versioned items (settings, uploads, caches, data…) unless I maintain
    a separate filter duplicating the svn:ignore data.
    >
    I could keep my current method and write a bunch of Subversion hook
    scripts in PHP (I’m not proficient in any other language available) to
    keep the data in synch but I looks like a overwhelming effort that can
    easily break. So I wonder how is everyone else doing it. But according
    to my googling the answer is: writing lots of custom scripts!
    >
    Is it the only way? Is there a tool to help with this common task? Can
    Apache Ant be used for this? How do *you* do it?
    >
    >
    >
    I use svn or cvs here (depending on the project). I just keep a
    development system then use one of the many FTP programs which compares
    file date/time (ie. WinSCP, FileZilla, CoreFTP).

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Evil Otto

      #3
      Re: Publish to live site from Subversion

      On Nov 13, 6:11 am, "Álvaro G. Vicario"
      <alvaroNOSPAMTH A...@demogracia .comwrote:
      I’ve been using Subversion for a while to maintain the PHP web apps and
      sites I develop in my Windows box. But when I want to publish a new
      release I update the live site manually and I want to improve this process.
      >
      I can’t simply export to a fresh directory and upload all files because
      that won’t handle renames and deletions (and the upload will take
      forever anyway). I typically use WinMerge to find out what files changed
      but there’re some drawbacks:
      >
      * It can’t compare files through FTP (and if it could, I guess it’d need
      to download the whole site every time) so I need to maintain a local
      copy of the live site and upload files manually.
      >
      * It can’t use the repository information so it won’t ignore
      non-versioned items (settings, uploads, caches, data…) unless I maintain
      a separate filter duplicating the svn:ignore data.
      >
      I could keep my current method and write a bunch of Subversion hook
      scripts in PHP (I’m not proficient in any other language available) to
      keep the data in synch but I looks like a overwhelming effort that can
      easily break. So I wonder how is everyone else doing it. But according
      to my googling the answer is: writing lots of custom scripts!
      >
      Is it the only way? Is there a tool to help with this common task? Can
      Apache Ant be used for this? How do *you* do it?
      >
      --
      --http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
      -- Mi sitio sobre programación web:http://bits.demogracia.com
      -- Mi web de humor al baño María:http://www.demogracia.com
      --
      What I've been doing is to determine where the document root is on my
      hosting (eg domain.com/html, public_html, whatever) and make that into
      a symlink pointing to a different directory where the site lives.
      Then when I have an update to do, I export the version I want to
      upload, tarball it up, upload it to my hosting, expand it, and then
      delete the old symlink and create a new on pointing to the new
      directory. If you do both operations at the same time it's very
      nearly atomic (eg rm html;ln -s versionNumber.h tml html).
      Occasionally you'll run into a situation that requires you copy some
      files from the 'old' directory and overwrite something in the 'new'
      directory (such as image files that your users have uploaded,
      etc. .htaccess and .htpasswd may also enter into the mix. It stays
      largely clean, however.

      This generally requires access to the command line of the server, and
      not all hosting allows you to SSH into a shared server. (Nexcess.net
      does, I'm working with them on a project currently.)

      There's more than one way to skin this cat. rsync (if available)
      would provide another solution, as well.

      Comment

      • Willem Bogaerts

        #4
        Re: Publish to live site from Subversion

        I’ve been using Subversion for a while to maintain the PHP web apps and
        sites I develop in my Windows box. But when I want to publish a new
        release I update the live site manually and I want to improve this process.
        >
        I can’t simply export to a fresh directory and upload all files because
        that won’t handle renames and deletions (and the upload will take
        forever anyway). I typically use WinMerge ...
        Why? Why don't you just do an "svn update" on the web server? Failing
        that (because subversion is not installed, for example), you could try
        to mount the site directory somehow to your computer and use the
        subversion installation on your local PC to do the update.

        But it really is much easier to install the subversion client on the web
        server.

        You might find this useful:
        Setting Up A Modular Subversion Repository For PHP-Driven Websites Sharing code between projects is still not a trivial matter with subversion. Espe...


        Best regards,
        --
        Willem Bogaerts

        Application smith
        Kratz B.V.

        Comment

        • =?windows-1252?Q?=22=C1lvaro_G=2E_Vicario=22?=

          #5
          Re: Publish to live site from Subversion

          Willem Bogaerts escribió:
          >I’ve been using Subversion for a while to maintain the PHP web apps
          >and sites I develop in my Windows box. But when I want to publish a
          >new release I update the live site manually and I want to improve
          >this process.
          >>
          >I can’t simply export to a fresh directory and upload all files
          >because that won’t handle renames and deletions (and the upload
          >will take forever anyway). I typically use WinMerge ...
          >
          Why? Why don't you just do an "svn update" on the web server?
          It's an idea I hadn't thought about. If the live site is a working copy
          of a special branch (let's say, branches/live) all I need to do is
          merging the desired changes into branches/live and then updating the
          working copy. Apache can be configured quite easily to prevent access to
          ..svn directories.

          The only hassle is that I need to open my repositories to the outer
          world. And, of course, a hosting service with Subversion client is not
          always at your reach (where I live, customers seem to adore the
          overpriced poor quality hosting offered by well known local brands).
          Failing that (because subversion is not installed, for example), you
          could try to mount the site directory somehow to your computer and
          use the subversion installation on your local PC to do the update.
          I recall having tried Windows' "Network Places" to mount an FTP site but
          I discarded it because it was pretty useless (it would not allow command
          line, drive mapping or shell extensions). But perhaps there's a
          third-party tool I could use.

          Thank you for your suggestions.


          --
          -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
          -- Mi sitio sobre programación web: http://bits.demogracia.com
          -- Mi web de humor al baño María: http://www.demogracia.com
          --

          Comment

          • =?windows-1252?Q?=22=C1lvaro_G=2E_Vicario=22?=

            #6
            Re: Publish to live site from Subversion

            Jerry Stuckle escribió:
            Álvaro G. Vicario wrote:
            >I’ve been using Subversion for a while to maintain the PHP web apps
            >and sites I develop in my Windows box. But when I want to publish a
            >new release I update the live site manually and I want to improve this
            >process.
            [...]
            I use svn or cvs here (depending on the project). I just keep a
            development system then use one of the many FTP programs which compares
            file date/time (ie. WinSCP, FileZilla, CoreFTP).
            The idea is feasible (Subversion keeps the original file dates) but all
            FTP clients I've tried along the years are terrible at the task of
            syncing trees. (Note to self: eval SyncBack again.) But I still need to
            duplicate the handling of non-versioned items.

            Thank you for the tip.

            --
            -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
            -- Mi sitio sobre programación web: http://bits.demogracia.com
            -- Mi web de humor al baño María: http://www.demogracia.com
            --

            Comment

            • =?UTF-8?B?SXbDoW4gU8OhbmNoZXogT3J0ZWdh?=

              #7
              Re: Publish to live site from Subversion

              "Álvaro G. Vicario" wrote:
              The only hassle is that I need to open my repositories to the outer
              world.
              As long as you're configuring apache properly, you'll open *only* the
              subdirectories you want, not the enrite SVN tree.

              Or am I missing something there?

              --
              ----------------------------------
              Iván Sánchez Ortega -ivan-algarroba-sanchezortega-punto-es-

              ----------(8-) el hombre con el rabin de la boina m s largu del mundo

              Comment

              • Willem Bogaerts

                #8
                Re: Publish to live site from Subversion

                The only hassle is that I need to open my repositories to the outer
                world.
                You can restrict access to a limited set of known IP addresses.
                I recall having tried Windows' "Network Places" to mount an FTP site but
                I discarded it because it was pretty useless (it would not allow command
                line, drive mapping or shell extensions). But perhaps there's a
                third-party tool I could use.
                If you do a net search for "mount sshfs windows", you will probably find
                some 3rd-party tools.

                Best regards,
                --
                Willem Bogaerts

                Application smith
                Kratz B.V.

                Comment

                • =?windows-1252?Q?=22=C1lvaro_G=2E_Vicario=22?=

                  #9
                  Re: Publish to live site from Subversion

                  Iván Sánchez Ortega escribió:
                  "Álvaro G. Vicario" wrote:
                  >The only hassle is that I need to open my repositories to the outer
                  >world.
                  >
                  As long as you're configuring apache properly, you'll open *only* the
                  subdirectories you want, not the enrite SVN tree.
                  >
                  Or am I missing something there?
                  What I meant is that, currently, all my repositories are limited to the
                  local network (or even with no network at all). To access them from the
                  internet I'd need to forward a port in the router and double-check
                  Apache configuration. Which is doable, but not done. If you're to allow
                  outsiders into your room you need to make sure your drawers are properly
                  locked.

                  --
                  -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
                  -- Mi sitio sobre programación web: http://bits.demogracia.com
                  -- Mi web de humor al baño María: http://www.demogracia.com
                  --

                  Comment

                  • =?UTF-8?B?SXbDoW4gU8OhbmNoZXogT3J0ZWdh?=

                    #10
                    Re: Publish to live site from Subversion

                    "Álvaro G. Vicario" wrote:
                    What I meant is that, currently, all my repositories are limited to the
                    local network (or even with no network at all). To access them from the
                    internet I'd need to forward a port in the router and double-check
                    Apache configuration. Which is doable, but not done.
                    You could use either port-based virtualhosts, or .htaccess and an IP filter.

                    --
                    ----------------------------------
                    Iván Sánchez Ortega -ivan-algarroba-sanchezortega-punto-es-

                    XML is like violence. If it doesn't solve the problem, use more.
                    -- Fjolnir, on Slashdot

                    Comment

                    Working...