All of our projects are developed on our company’s development domain, protected by a password,  connected with a subversion, auto uploading new files to the testing domain etc. Projects are accessible to all coworkers and the client. This kind of development gained our productivity significantly.

Deploying a theme or a new functionality from the development environment to production is another story. Because of the protection on development domain and not knowing where our product will be hosted, we couldn’t use any of the existing solutions for deployment and updating without changing the whole development environment.

The problems I wanted to solve:

  • remove manual transfer of new files over FTP
  • remove manual backup we did before updating
  • have an option of reverting the update
  • automatic update when new version of solution is available
  • clear view of a changelog and a list of files that were changed in every version
  • prevent uploading all the files if only some were changed
  • allow updates only to our clients / subscribers
  • extremely simple integration to use custom updates
  • use WordPress update functionality
  • not be dependent on facts where the solution is developed (domain, server, localhost), how development is protected
  • client must have an option to install other solutions of ours

I started with a few starting points:

  • Implementation of automatic update functionality into new solution should not take more than a line of information to implement
  • Have a single plugin for the client that will take care of updating all of our solutions. I really do not want to have repeated functionality.
  • Have some kind of overview of all our products and solutions
  • Have some kind of licence / product manager for clients

The result of that is, that

when we develop new stuff, we have to:

  1. Install our plugin named 2repo_host on development website, which serves for packaging our solution for updates we develop on that site
  2. insert a “line” of code, that register new product / solution for automatic updates

    function some_function_name_you_pick( $sources ){
    $sources[ __FILE__ ] = ‘http://some-protected-domain-where-you-develop.com’;
    return $sources;
    }
    add_filter( '2repo_plugins', ‘some_function_name_you_pick’ );

On the clients / production website:

  1. Install our plugin named 2repo
  2. Input clients credential for automatic updates

And that is all, our solutions and automatic updates are now running and are fully available to our client 🙂

Of course I wouldn’t be myself if 2repo and 2repo_host plugins weren’t also a part of updates where they both serve for self functionality. It is kind of a funny feeling when update functionality is updating itself.

But that’s me 🙂

Let me know of any custom solutions you wrote to optimize your work.