How to deploy with Wordpress

2

I want to increase the agility of my projects with Wordpress . I usually use git only in themes. When everything is ready, I upload the theme in the traditional way, via FTP. Of course, I know it's wrong and that's not the way to go.

My question is: should I version all the Wordpress code and deploy the same way I do with Ruby on Rails or just do the versioning of the theme but do an automated deploy of it individually?

My question is because the Wordpress development team launches updates with a certain frequency ... and it is always advisable to keep it updated. How would I deal with this? Every time an update is released I will have to do a new deploy with the new version for all my clients?

    
asked by anonymous 28.06.2015 / 15:00

2 answers

1

The first thing you need to keep in mind is: I need to version Wordpress >

You will not have problems with deploy , as it will treat the project as an whole . For this, keep in mind that any automatic updating or editing through WordPress file editor can bring conflicts in the structure of . To avoid these conflicts, there are settings that can be made to prevent this:

  • Disabling Plugin Editor and Theme:
  • Example: core

  • Disabling automatic updates:
  • Example: define( 'DISALLOW_FILE_EDIT', true );

    You may also need to add define( 'WP_AUTO_UPDATE_CORE', false ); to avoid updating filter or themes:

    add_filter( 'auto_update_plugin', '__return_false' );
    add_filter( 'auto_update_theme', '__return_false' );
    
  • Create a branch for each core update:
  • As the updates will not be performed automatically, with each update you should do this manually (yes, that's right). Particularly I find this costly for the process.

  • Some files should be in plugin :
  • Files as .gitignore , and the directories of wp-config.php and uploads should be outside the versioning scope.

  • Stay tuned to local settings:
  • Having more than one environment, there is more concern about environment variables that will be in upgrade .

      

    All these and other tips I found in this article (very interesting):    Keeping WordPress Under [Version] Control with Git

    On the deploy itself, the @IvanFerrer response has a link with more information.

        
    22.09.2015 / 17:02
    1

    You can do this through an online account with GitHub or BitBucket . This video guides you how.

    First create the versioning of your project on your machine and then clone your project on the remote server:

    git clone user@servidor:/caminho/para/o/repositorio

    If you have not cloned an existing repository and want to connect your repository to a remote server, you must add it with:

    git remote add origin http://seu-endereco-repositorio.git

    Once you have your repository launched, to deploy automatically, follow this tutorial .

        
    29.06.2015 / 20:06